Skip to content

Commit

Permalink
Add release note
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Jan 31, 2024
1 parent 6e729bf commit c64c8c1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions releasenotes/notes/qasm3-importer-0ba0691bcdeba72f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
features:
- |
The :mod:`qiskit.qasm3` package now contains a built-in, Rust-based parser for reading OpenQASM
3 programs into :class:`.QuantumCircuit`\ s, found at :func:`qiskit.qasm3.load_experimental` and
:func:`~.qasm3.loads_experimental`. These are typically several times faster than the existing,
pure Python :func:`~.qasm3.load` and :func:`~.qasm3.loads` functions, which additionally require
``qiskit-qasm3-import`` to be installed.
For example, we can create a 20,000-instruction entangling :class:`.QuantumCircuit`::
import numpy as np
import qiskit.qasm3
from qiskit.circuit.library import RealAmplitudes
qc = RealAmplitudes(100, reps=100, flatten=True)
qc = qc.assign_parameters(np.random.rand(qc.num_parameters))
oq3 = qiskit.qasm3.dumps(qc)
The old :func:`.qasm3.loads` took about 7.3s to load the resulting OpenQASM 3 program, whereas
:func:`.qasm3.loads_experimental` took under 300ms on a consumer Macbook Pro (i7, 2020)–a speedup
of 25x!
The supported feature set of the experimental parser is very limited in this preview version,
but this will expand as both the Qiskit side and `the native Rust-based parser
<https://github.com/Qiskit/openqasm3_parser>`__ improve.
One of our main goals with this new parser, alongside the huge speed improvements, is to provide
top-quality error diagnostics. As with other parts of the parser, these are a work in progress,
but you'll start to see much higher quality error messages displayed when parsing invalid
OpenQASM 3 programs with the experimental parser.

0 comments on commit c64c8c1

Please sign in to comment.