Skip to content

Commit

Permalink
Restrict version-number output of OpenQASM 3 exporter
Browse files Browse the repository at this point in the history
The exporter previously claimed to simply be `OPENQASM 3;`, though the
OpenQASM project has made it clear that they may include minor versions
of the language in the future.  This updates the exporter to claim to be
version `3.0`, so that it does not falsely imply that it matches syntax
of a later version of the language specification.
  • Loading branch information
jakelishman committed Dec 14, 2023
1 parent c865c56 commit b76bdba
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 60 deletions.
2 changes: 1 addition & 1 deletion qiskit/qasm3/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def _lookup_variable(self, variable) -> ast.Identifier:

def build_header(self):
"""Builds a Header"""
version = ast.Version("3")
version = ast.Version("3.0")
includes = self.build_includes()
return ast.Header(version, includes)

Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/qasm3-minor-version-2ae00ba8f72a1a53.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
The OpenQASM 3 exporters :func:`.qasm3.dump` and :func:`~.qasm3.dumps` will now correctly output
files claiming to be version ``3.0`` rather than the unqualified ``3``, since the OpenQASM 3
project has now standardised on versioning.
Loading

0 comments on commit b76bdba

Please sign in to comment.