From 307adc5d14fe33a1206b488ac4912c366fd6192a Mon Sep 17 00:00:00 2001 From: Luciano Bello Date: Fri, 29 Sep 2023 19:29:00 +0200 Subject: [PATCH] Many mentions to QASM should be changed to OpenQASM 2 (#9351) * Many mentions to QASM should be changed to OpenQASM2 * adjust tests * another round * suggestion in https://github.com/Qiskit/qiskit-terra/pull/9351/files#r1068676297 * https://github.com/Qiskit/qiskit-terra/pull/9351/files#r1068704441 * Normalise spacing of OpenQASM [23] --------- Co-authored-by: Jake Lishman --- qiskit/algorithms/optimizers/spsa.py | 2 +- qiskit/assembler/assemble_circuits.py | 4 +-- qiskit/circuit/controlflow/for_loop.py | 2 +- qiskit/circuit/library/hamiltonian_gate.py | 2 +- qiskit/circuit/quantumcircuit.py | 19 +++++------ qiskit/compiler/assembler.py | 4 +-- qiskit/converters/ast_to_dag.py | 2 +- qiskit/providers/basicaer/qasm_simulator.py | 4 +-- .../fake_provider/fake_qasm_backend.py | 2 +- .../fake_provider/fake_qasm_simulator.py | 2 +- .../providers/models/backendconfiguration.py | 11 +++---- qiskit/qasm/node/__init__.py | 2 +- qiskit/qasm/node/binaryoperator.py | 2 +- qiskit/qasm/node/unaryoperator.py | 6 ++-- qiskit/qasm/qasm.py | 2 +- qiskit/qasm3/__init__.py | 10 +++--- qiskit/qasm3/exporter.py | 10 +++--- qiskit/qasm3/printer.py | 6 ++-- qiskit/qobj/common.py | 2 +- qiskit/qobj/qasm_qobj.py | 32 +++++++++---------- qiskit/result/result.py | 2 +- qiskit/tools/jupyter/library.py | 2 +- test/python/qasm3/test_export.py | 6 ++-- test/python/transpiler/test_mappers.py | 2 +- 24 files changed, 69 insertions(+), 69 deletions(-) diff --git a/qiskit/algorithms/optimizers/spsa.py b/qiskit/algorithms/optimizers/spsa.py index fb39ad781f72..7eebba8df529 100644 --- a/qiskit/algorithms/optimizers/spsa.py +++ b/qiskit/algorithms/optimizers/spsa.py @@ -65,7 +65,7 @@ class SPSA(Optimizer): SPSA can be used in the presence of noise, and it is therefore indicated in situations involving measurement uncertainty on a quantum computation when finding a minimum. - If you are executing a variational algorithm using a Quantum ASseMbly Language (QASM) + If you are executing a variational algorithm using an OpenQASM simulator or a real device, SPSA would be the most recommended choice among the optimizers provided here. diff --git a/qiskit/assembler/assemble_circuits.py b/qiskit/assembler/assemble_circuits.py index 64cc42fa4834..06d056a05f89 100644 --- a/qiskit/assembler/assemble_circuits.py +++ b/qiskit/assembler/assemble_circuits.py @@ -105,7 +105,7 @@ def _assemble_circuit( if calibrations: config.calibrations = calibrations - # Convert conditionals from QASM-style (creg ?= int) to qobj-style + # Convert conditionals from OpenQASM-2-style (creg ?= int) to qobj-style # (register_bit ?= 1), by assuming device has unlimited register slots # (supported only for simulators). Map all measures to a register matching # their clbit_index, create a new register slot for every conditional gate @@ -213,7 +213,7 @@ def _extract_common_calibrations( and delete them from their local experiments. Args: - experiments: The list of Qasm experiments that are being assembled into one qobj + experiments: The list of OpenQASM experiments that are being assembled into one qobj Returns: The input experiments with modified calibrations, and common calibrations, if there diff --git a/qiskit/circuit/controlflow/for_loop.py b/qiskit/circuit/controlflow/for_loop.py index 5761dc7ab673..f0e79e47ca81 100644 --- a/qiskit/circuit/controlflow/for_loop.py +++ b/qiskit/circuit/controlflow/for_loop.py @@ -108,7 +108,7 @@ def params(self, parameters): ) # Consume indexset into a tuple unless it was provided as a range. - # Preserve ranges so that they can be exported as OpenQASM3 ranges. + # Preserve ranges so that they can be exported as OpenQASM 3 ranges. indexset = indexset if isinstance(indexset, range) else tuple(indexset) self._params = [indexset, loop_parameter, body] diff --git a/qiskit/circuit/library/hamiltonian_gate.py b/qiskit/circuit/library/hamiltonian_gate.py index 8bca4b42c692..eb7e511102bb 100644 --- a/qiskit/circuit/library/hamiltonian_gate.py +++ b/qiskit/circuit/library/hamiltonian_gate.py @@ -133,7 +133,7 @@ def _define(self): ) def qasm(self): """Raise an error, as QASM is not defined for the HamiltonianGate.""" - raise CircuitError("HamiltonianGate has no QASM definition.") + raise CircuitError("HamiltonianGate has no OpenQASM 2 definition.") def validate_parameter(self, parameter): """Hamiltonian parameter has to be an ndarray, operator or float.""" diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py index 40c6f55410bf..971ec59016bb 100644 --- a/qiskit/circuit/quantumcircuit.py +++ b/qiskit/circuit/quantumcircuit.py @@ -1608,8 +1608,8 @@ def qasm( interface for other serialisers in Qiskit. Args: - formatted (bool): Return formatted Qasm string. - filename (str): Save Qasm to file with name 'filename'. + formatted (bool): Return formatted OpenQASM 2.0 string. + filename (str): Save OpenQASM 2.0 to file with name 'filename'. encoding (str): Optionally specify the encoding to use for the output file if ``filename`` is specified. By default this is set to the system's default encoding (ie whatever @@ -1634,7 +1634,7 @@ def qasm( print(out, file=file) if formatted: - _optionals.HAS_PYGMENTS.require_now("formatted OpenQASM 2 output") + _optionals.HAS_PYGMENTS.require_now("formatted OpenQASM 2.0 output") import pygments from pygments.formatters import ( # pylint: disable=no-name-in-module @@ -2390,13 +2390,14 @@ def remove_final_measurements(self, inplace: bool = True) -> Optional["QuantumCi @staticmethod def from_qasm_file(path: str) -> "QuantumCircuit": - """Take in a QASM file and generate a QuantumCircuit object. + """Read an OpenQASM 2.0 program from a file and convert to an instance of + :class:`.QuantumCircuit`. Args: - path (str): Path to the file for a QASM program + path (str): Path to the file for an OpenQASM 2 program Return: - QuantumCircuit: The QuantumCircuit object for the input QASM + QuantumCircuit: The QuantumCircuit object for the input OpenQASM 2. See also: :func:`.qasm2.load`: the complete interface to the OpenQASM 2 importer. @@ -2414,12 +2415,12 @@ def from_qasm_file(path: str) -> "QuantumCircuit": @staticmethod def from_qasm_str(qasm_str: str) -> "QuantumCircuit": - """Take in a QASM string and generate a QuantumCircuit object. + """Convert a string containing an OpenQASM 2.0 program to a :class:`.QuantumCircuit`. Args: - qasm_str (str): A QASM program string + qasm_str (str): A string containing an OpenQASM 2.0 program. Return: - QuantumCircuit: The QuantumCircuit object for the input QASM + QuantumCircuit: The QuantumCircuit object for the input OpenQASM 2 See also: :func:`.qasm2.loads`: the complete interface to the OpenQASM 2 importer. diff --git a/qiskit/compiler/assembler.py b/qiskit/compiler/assembler.py index 9ded481b2ecc..7374f24610a4 100644 --- a/qiskit/compiler/assembler.py +++ b/qiskit/compiler/assembler.py @@ -113,8 +113,8 @@ def assemble( ``n_qubits.`` schedule_los: Experiment level (ie circuit or schedule) LO frequency configurations for qubit drive and measurement channels. These values override the job level values from - ``default_qubit_los`` and ``default_meas_los``. Frequencies are in Hz. Settable for qasm - and pulse jobs. + ``default_qubit_los`` and ``default_meas_los``. Frequencies are in Hz. Settable for + OpenQASM 2 and pulse jobs. meas_level: Set the appropriate level of the measurement output for pulse experiments. meas_return: Level of measurement data for the backend to return. diff --git a/qiskit/converters/ast_to_dag.py b/qiskit/converters/ast_to_dag.py index 9fb3361d9555..4cd60f56573c 100644 --- a/qiskit/converters/ast_to_dag.py +++ b/qiskit/converters/ast_to_dag.py @@ -366,7 +366,7 @@ def _process_node(self, node): return None def _gate_rules_to_qiskit_circuit(self, node, params): - """From a gate definition in qasm, to a QuantumCircuit format.""" + """From a gate definition in OpenQASM, to a QuantumCircuit format.""" rules = [] qreg = QuantumRegister(node["n_bits"]) bit_args = {node["bits"][i]: q for i, q in enumerate(qreg)} diff --git a/qiskit/providers/basicaer/qasm_simulator.py b/qiskit/providers/basicaer/qasm_simulator.py index 127ea1c26768..a48112f5c144 100644 --- a/qiskit/providers/basicaer/qasm_simulator.py +++ b/qiskit/providers/basicaer/qasm_simulator.py @@ -12,7 +12,7 @@ """Contains a (slow) Python simulator. -It simulates a qasm quantum circuit (an experiment) that has been compiled +It simulates an OpenQASM 2 quantum circuit (an experiment) that has been compiled to run on the simulator. It is exponential in the number of qubits. The simulator is run using @@ -53,7 +53,7 @@ class QasmSimulatorPy(BackendV1): - """Python implementation of a qasm simulator.""" + """Python implementation of an OpenQASM 2 simulator.""" MAX_QUBITS_MEMORY = int(log2(local_hardware_info()["memory"] * (1024**3) / 16)) diff --git a/qiskit/providers/fake_provider/fake_qasm_backend.py b/qiskit/providers/fake_provider/fake_qasm_backend.py index 137d585bf4b3..55dad4aff601 100644 --- a/qiskit/providers/fake_provider/fake_qasm_backend.py +++ b/qiskit/providers/fake_provider/fake_qasm_backend.py @@ -28,7 +28,7 @@ class FakeQasmBackend(FakeBackend): - """A fake qasm backend.""" + """A fake OpenQASM backend.""" dirname = None conf_filename = None diff --git a/qiskit/providers/fake_provider/fake_qasm_simulator.py b/qiskit/providers/fake_provider/fake_qasm_simulator.py index 790496856024..055fb613e999 100644 --- a/qiskit/providers/fake_provider/fake_qasm_simulator.py +++ b/qiskit/providers/fake_provider/fake_qasm_simulator.py @@ -11,7 +11,7 @@ # that they have been altered from the originals. """ -Fake qasm simulator. +Fake OpenQASM simulator. """ from qiskit.providers.models import GateConfig, QasmBackendConfiguration diff --git a/qiskit/providers/models/backendconfiguration.py b/qiskit/providers/models/backendconfiguration.py index 87150bcf75ff..e346e293a38b 100644 --- a/qiskit/providers/models/backendconfiguration.py +++ b/qiskit/providers/models/backendconfiguration.py @@ -32,9 +32,9 @@ class GateConfig: """Class representing a Gate Configuration Attributes: - name: the gate name as it will be referred to in Qasm. + name: the gate name as it will be referred to in OpenQASM. parameters: variable names for the gate parameters (if any). - qasm_def: definition of this gate in terms of Qasm primitives U + qasm_def: definition of this gate in terms of OpenQASM 2 primitives U and CX. """ @@ -51,11 +51,10 @@ def __init__( """Initialize a GateConfig object Args: - name (str): the gate name as it will be referred to in Qasm. + name (str): the gate name as it will be referred to in OpenQASM. parameters (list): variable names for the gate parameters (if any) as a list of strings. - qasm_def (str): definition of this gate in terms of Qasm primitives - U and CX. + qasm_def (str): definition of this gate in terms of OpenQASM 2 primitives U and CX. coupling_map (list): An optional coupling map for the gate. In the form of a list of lists of integers representing the qubit groupings which are coupled by this gate. @@ -194,7 +193,7 @@ def __repr__(self): class QasmBackendConfiguration: - """Class representing a Qasm Backend Configuration. + """Class representing an OpenQASM 2.0 Backend Configuration. Attributes: backend_name: backend name. diff --git a/qiskit/qasm/node/__init__.py b/qiskit/qasm/node/__init__.py index f93dded9d1a6..09e24db01bf5 100644 --- a/qiskit/qasm/node/__init__.py +++ b/qiskit/qasm/node/__init__.py @@ -10,7 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""QASM nodes.""" +"""OpenQASM 2 nodes.""" from .barrier import Barrier from .binaryop import BinaryOp diff --git a/qiskit/qasm/node/binaryoperator.py b/qiskit/qasm/node/binaryoperator.py index 733e51258a40..57e7d883c547 100644 --- a/qiskit/qasm/node/binaryoperator.py +++ b/qiskit/qasm/node/binaryoperator.py @@ -48,5 +48,5 @@ def operation(self): raise NodeException(f"internal error: undefined operator '{self.value}'") from ex def qasm(self): - """Return the QASM representation.""" + """Return the OpenQASM 2 representation.""" return self.value diff --git a/qiskit/qasm/node/unaryoperator.py b/qiskit/qasm/node/unaryoperator.py index 76122f78dcd3..a81e9f0737b1 100644 --- a/qiskit/qasm/node/unaryoperator.py +++ b/qiskit/qasm/node/unaryoperator.py @@ -10,7 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Node for an OPENQASM unary operator.""" +"""Node for an OpenQASM 2 unary operator.""" import operator @@ -25,7 +25,7 @@ class UnaryOperator(Node): - """Node for an OPENQASM unary operator. + """Node for an OpenQASM 2 unary operator. This node has no children. The data is in the value field. """ @@ -45,5 +45,5 @@ def operation(self): raise NodeException(f"internal error: undefined prefix '{self.value}'") from ex def qasm(self): - """Return QASM representation.""" + """Return OpenQASM 2 representation.""" return self.value diff --git a/qiskit/qasm/qasm.py b/qiskit/qasm/qasm.py index 055cc5c12a8f..ded52b32d3fc 100644 --- a/qiskit/qasm/qasm.py +++ b/qiskit/qasm/qasm.py @@ -25,7 +25,7 @@ def __init__(self, filename=None, data=None): if filename is None and data is None: raise QasmError("Missing input file and/or data") if filename is not None and data is not None: - raise QasmError("File and data must not both be specified initializing qasm") + raise QasmError("File and data must not both be specified initializing OpenQASM 2") self._filename = filename self._data = data diff --git a/qiskit/qasm3/__init__.py b/qiskit/qasm3/__init__.py index 744a40f5dad3..36bb4dcc2843 100644 --- a/qiskit/qasm3/__init__.py +++ b/qiskit/qasm3/__init__.py @@ -182,25 +182,25 @@ def dumps(circuit, **kwargs) -> str: - """Serialize a :class:`~qiskit.circuit.QuantumCircuit` object in an OpenQASM3 string. + """Serialize a :class:`~qiskit.circuit.QuantumCircuit` object in an OpenQASM 3 string. Args: circuit (QuantumCircuit): Circuit to serialize. **kwargs: Arguments for the :obj:`.Exporter` constructor. Returns: - str: The OpenQASM3 serialization + str: The OpenQASM 3 serialization """ return Exporter(**kwargs).dumps(circuit) def dump(circuit, stream, **kwargs) -> None: - """Serialize a :class:`~qiskit.circuit.QuantumCircuit` object as a OpenQASM3 stream to file-like - object. + """Serialize a :class:`~qiskit.circuit.QuantumCircuit` object as an OpenQASM 3 stream to + file-like object. Args: circuit (QuantumCircuit): Circuit to serialize. - stream (TextIOBase): stream-like object to dump the OpenQASM3 serialization + stream (TextIOBase): stream-like object to dump the OpenQASM 3 serialization **kwargs: Arguments for the :obj:`.Exporter` constructor. """ diff --git a/qiskit/qasm3/exporter.py b/qiskit/qasm3/exporter.py index 4cbca3961366..0a7c4f94b7b2 100644 --- a/qiskit/qasm3/exporter.py +++ b/qiskit/qasm3/exporter.py @@ -145,7 +145,7 @@ def __init__( basis_gates: the basic defined gate set of the backend. disable_constants: if ``True``, always emit floating-point constants for numeric parameter values. If ``False`` (the default), then values close to multiples of - QASM 3 constants (``pi``, ``euler``, and ``tau``) will be emitted in terms of those + OpenQASM 3 constants (``pi``, ``euler``, and ``tau``) will be emitted in terms of those constants instead, potentially improving accuracy in the output. alias_classical_registers: If ``True``, then bits may be contained in more than one register. If so, the registers will be emitted using "alias" definitions, which @@ -176,13 +176,13 @@ def __init__( self.experimental = experimental def dumps(self, circuit): - """Convert the circuit to QASM 3, returning the result as a string.""" + """Convert the circuit to OpenQASM 3, returning the result as a string.""" with io.StringIO() as stream: self.dump(circuit, stream) return stream.getvalue() def dump(self, circuit, stream): - """Convert the circuit to QASM 3, dumping the result to a file or text stream.""" + """Convert the circuit to OpenQASM 3, dumping the result to a file or text stream.""" builder = QASM3Builder( circuit, includeslist=self.includes, @@ -888,7 +888,7 @@ def build_for_loop(self, instruction: CircuitInstruction) -> ast.ForLoopStatemen else: loop_parameter_ast = self._register_variable(loop_parameter, scope) if isinstance(indexset, range): - # QASM 3 uses inclusive ranges on both ends, unlike Python. + # OpenQASM 3 uses inclusive ranges on both ends, unlike Python. indexset_ast = ast.Range( start=self.build_integer(indexset.start), end=self.build_integer(indexset.stop - 1), @@ -899,7 +899,7 @@ def build_for_loop(self, instruction: CircuitInstruction) -> ast.ForLoopStatemen indexset_ast = ast.IndexSet([self.build_integer(value) for value in indexset]) except QASM3ExporterError: raise QASM3ExporterError( - "The values in QASM 3 'for' loops must all be integers, but received" + "The values in OpenQASM 3 'for' loops must all be integers, but received" f" '{indexset}'." ) from None body_ast = self.build_program_block(loop_circuit) diff --git a/qiskit/qasm3/printer.py b/qiskit/qasm3/printer.py index 883c8413c7f6..fee68824f0c8 100644 --- a/qiskit/qasm3/printer.py +++ b/qiskit/qasm3/printer.py @@ -10,7 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Printers for QASM 3 AST nodes.""" +"""Printers for OpenQASM 3 AST nodes.""" import collections import io @@ -60,7 +60,7 @@ class BasicPrinter: - """A QASM 3 AST visitor which writes the tree out in text mode to a stream, where the only + """An OpenQASM 3 AST visitor which writes the tree out in text mode to a stream, where the only formatting is simple block indentation.""" _CONSTANT_LOOKUP = { @@ -134,7 +134,7 @@ def visit(self, node: ast.ASTNode) -> None: however, if you want to build up a file bit-by-bit manually. Args: - node (ASTNode): the node to convert to QASM 3 and write out to the stream. + node (ASTNode): the node to convert to OpenQASM 3 and write out to the stream. Raises: RuntimeError: if an AST node is encountered that the visitor is unable to parse. This diff --git a/qiskit/qobj/common.py b/qiskit/qobj/common.py index 506ffbca3b2e..9b219e5ba8d0 100644 --- a/qiskit/qobj/common.py +++ b/qiskit/qobj/common.py @@ -31,7 +31,7 @@ def __init__(self, **kwargs): self.__dict__.update(kwargs) def to_dict(self): - """Return a dictionary format representation of the QASM Qobj. + """Return a dictionary format representation of the OpenQASM 2 Qobj. Returns: dict: The dictionary form of the QobjHeader. diff --git a/qiskit/qobj/qasm_qobj.py b/qiskit/qobj/qasm_qobj.py index 47554a2a875a..983da1dcfd3b 100644 --- a/qiskit/qobj/qasm_qobj.py +++ b/qiskit/qobj/qasm_qobj.py @@ -10,7 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""Module providing definitions of QASM Qobj classes.""" +"""Module providing definitions of OpenQASM 2 Qobj classes.""" import copy import pprint @@ -194,10 +194,10 @@ def __eq__(self, other): class QasmQobjExperiment: - """A QASM Qobj Experiment. + """An OpenQASM 2 Qobj Experiment. - Each instance of this class is used to represent a QASM experiment as - part of a larger QASM qobj. + Each instance of this class is used to represent an OpenQASM 2 experiment as + part of a larger OpenQASM 2 qobj. """ def __init__(self, config=None, header=None, instructions=None): @@ -223,7 +223,7 @@ def __repr__(self): return out def __str__(self): - out = "\nQASM Experiment:\n" + out = "\nOpenQASM2 Experiment:\n" config = pprint.pformat(self.config.to_dict()) header = pprint.pformat(self.header.to_dict()) out += "Header:\n%s\n" % header @@ -276,7 +276,7 @@ def __eq__(self, other): class QasmQobjConfig(SimpleNamespace): - """A configuration for a QASM Qobj.""" + """A configuration for an OpenQASM 2 Qobj.""" def __init__( self, @@ -361,7 +361,7 @@ def __init__( self.__dict__.update(kwargs) def to_dict(self): - """Return a dictionary format representation of the QASM Qobj config. + """Return a dictionary format representation of the OpenQASM 2 Qobj config. Returns: dict: The dictionary form of the QasmQobjConfig. @@ -404,13 +404,13 @@ def __eq__(self, other): class QasmQobjExperimentHeader(QobjDictField): - """A header for a single QASM experiment in the qobj.""" + """A header for a single OpenQASM 2 experiment in the qobj.""" pass class QasmQobjExperimentConfig(QobjDictField): - """Configuration for a single QASM experiment in the qobj.""" + """Configuration for a single OpenQASM 2 experiment in the qobj.""" def __init__(self, calibrations=None, qubit_lo_freq=None, meas_lo_freq=None, **kwargs): """ @@ -541,12 +541,12 @@ def from_dict(cls, data): class QasmQobj: - """A QASM Qobj.""" + """An OpenQASM 2 Qobj.""" def __init__(self, qobj_id=None, config=None, experiments=None, header=None): - """Instantiate a new QASM Qobj Object. + """Instantiate a new OpenQASM 2 Qobj Object. - Each QASM Qobj object is used to represent a single payload that will + Each OpenQASM 2 Qobj object is used to represent a single payload that will be passed to a Qiskit provider. It mirrors the Qobj the published `Qobj specification `_ for OpenQASM experiments. @@ -588,12 +588,12 @@ def __str__(self): return out def to_dict(self): - """Return a dictionary format representation of the QASM Qobj. + """Return a dictionary format representation of the OpenQASM 2 Qobj. - Note this dict is not in the json wire format expected by IBMQ and qobj - specification because complex numbers are still of type complex. Also + Note this dict is not in the json wire format expected by IBM and Qobj + specification because complex numbers are still of type complex. Also, this may contain native numpy arrays. When serializing this output - for use with IBMQ you can leverage a json encoder that converts these + for use with IBM systems, you can leverage a json encoder that converts these as expected. For example: .. code-block:: diff --git a/qiskit/result/result.py b/qiskit/result/result.py index b9c820f584b5..d99be996080e 100644 --- a/qiskit/result/result.py +++ b/qiskit/result/result.py @@ -156,7 +156,7 @@ def data(self, experiment=None): depends on the backend it ran on and the settings of `meas_level`, `meas_return` and `memory`. - QASM backends return a dictionary of dictionary with the key + OpenQASM backends return a dictionary of dictionary with the key 'counts' and with the counts, with the second dictionary keys containing a string in hex format (``0x123``) and values equal to the number of times this outcome was measured. diff --git a/qiskit/tools/jupyter/library.py b/qiskit/tools/jupyter/library.py index b2ca9973d50d..09057db8c355 100644 --- a/qiskit/tools/jupyter/library.py +++ b/qiskit/tools/jupyter/library.py @@ -135,7 +135,7 @@ def properties_widget(circuit: QuantumCircuit) -> wid.VBox: additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.", ) def qasm_widget(circuit: QuantumCircuit) -> wid.VBox: - """Generate a QASM widget with header for a quantum circuit. + """Generate an OpenQASM widget with header for a quantum circuit. Args: circuit: Input quantum circuit. diff --git a/test/python/qasm3/test_export.py b/test/python/qasm3/test_export.py index 26876667abc7..0f64fa6ba12b 100644 --- a/test/python/qasm3/test_export.py +++ b/test/python/qasm3/test_export.py @@ -755,7 +755,7 @@ def test_opaque_instruction_in_basis_gates(self): ) def test_reset_statement(self): - """Test that a reset statement gets output into valid QASM 3. This includes tests of reset + """Test that a reset statement gets output into valid OpenQASM 3. This includes tests of reset operations on single qubits and in nested scopes.""" qreg = QuantumRegister(2, "qr") qc = QuantumCircuit(qreg) @@ -775,7 +775,7 @@ def test_reset_statement(self): self.assertEqual(Exporter(includes=[]).dumps(qc), expected_qasm) def test_delay_statement(self): - """Test that delay operations get output into valid QASM 3.""" + """Test that delay operations get output into valid OpenQASM 3.""" qreg = QuantumRegister(2, "qr") qc = QuantumCircuit(qreg) qc.delay(100, qreg[0], unit="ms") @@ -2364,7 +2364,7 @@ def test_disallow_for_loops_with_non_integers(self, indices): qc.for_loop(indices, None, loop_body, [], []) exporter = Exporter() with self.assertRaisesRegex( - QASM3ExporterError, r"The values in QASM 3 'for' loops must all be integers.*" + QASM3ExporterError, r"The values in OpenQASM 3 'for' loops must all be integers.*" ): exporter.dumps(qc) diff --git a/test/python/transpiler/test_mappers.py b/test/python/transpiler/test_mappers.py index 6a3d0d1748e3..4c56b9dedb53 100644 --- a/test/python/transpiler/test_mappers.py +++ b/test/python/transpiler/test_mappers.py @@ -13,7 +13,7 @@ """Meta tests for mappers. The test checks the output of the swapper to a ground truth DAG (one for each -test/swapper) saved in as a QASM (in `test/python/qasm/`). If they need +test/swapper) saved in as an OpenQASM 2 file (in `test/python/qasm/`). If they need to be regenerated, the DAG candidate is compiled and run in a simulator and the count is checked before being saved. This happens with (in the root directory):