-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force decimal points in OpenQASM 2 floats (#10532)
* Force decimal points in OpenQASM 2 floats The letter of the OpenQASM 2 specification has a regex defining floating-point literals that requires a decimal point, even in the presence of an exponential component. This is unusual for most programming languages, but Qiskit's exporter should follow the spec as close as we can to increase interop. Our parser accepts floats with an exponent and no decimal point as a minor syntax extension, unless in strict mode. * Simplify English
- Loading branch information
1 parent
c8552f6
commit 4722c50
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
Angles in the OpenQASM 2 exporter (:func:`.QuantumCircuit.qasm`) will now always include a | ||
decimal point, for example in the case of ``1.e-5``. This is required by a strict interpretation of the | ||
floating-point-literal specification in OpenQASM 2. Qiskit's OpenQASM 2 parser | ||
(:func:`.qasm2.load` and :func:`~.qasm2.loads`) is more permissive by default, and will allow | ||
``1e-5`` without the decimal point unless in ``strict`` mode. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters