Low-level simulator control¶
Direct access to simulator handles and the QASM parser. Most code should use
QuantumCircuit and the functions in
Execution and estimation instead.
- class Maestro(*args, **kwargs)¶
- create_simulator(self, sim_type: maestro.SimulatorType = SimulatorType.QCSim, sim_exec_type: maestro.SimulationType = SimulationType.MatrixProductState) int¶
- get_simulator(self, arg: int, /) maestro.Simulator¶
- class Simulator¶
-
- ApplyCU(self, control_qubit: int, target_qubit: int, theta: float, phi: float, lambda_: float, gamma: float = 0.0) None¶
- ApplyGenericOneQubitGate(self, qubit0: int, matrix: collections.abc.Sequence[collections.abc.Sequence[complex]]) None¶
Apply a 2x2 matrix; the first target is the least-significant local bit.
- ApplyGenericThreeQubitGate(self, qubit0: int, qubit1: int, qubit2: int, matrix: collections.abc.Sequence[collections.abc.Sequence[complex]]) None¶
Apply a 8x8 matrix; the first target is the least-significant local bit.
- ApplyGenericTwoQubitGate(self, qubit0: int, qubit1: int, matrix: collections.abc.Sequence[collections.abc.Sequence[complex]]) None¶
Apply a 4x4 matrix; the first target is the least-significant local bit.
- ApplyReset(self, qubits: collections.abc.Sequence[int]) None¶
- ExpectationValueOperators(self, qubits: collections.abc.Sequence[int], matrices: collections.abc.Sequence[numpy.ndarray[dtype=complex128, shape=(*, *), order='F']]) complex¶
- ExpectationValues(self, paulis: collections.abc.Sequence[str]) list[float]¶
Evaluate Pauli strings together on the current state, in input order.
- ExpectationValuesComplex(self, paulis: collections.abc.Sequence[str], normalized: bool = True) list[complex]¶
- GetGateFusionStatistics(self) maestro.GateFusionStatistics¶
- GetSimulationType(self) maestro.SimulationType¶
- GetSimulatorType(self) maestro.SimulatorType¶
- Measure(self, qubits: collections.abc.Sequence[int]) int¶
Measure and collapse the selected qubits; the first listed qubit is the least-significant result bit.
- MeasureMany(self, qubits: collections.abc.Sequence[int]) list[bool]¶
- Probabilities(self, outcomes: collections.abc.Sequence[int]) list[float]¶
Return probabilities for the given basis-state indices.
- SampleCounts(self, qubits: collections.abc.Sequence[int], shots: int = 1000) dict[int, int]¶
Sample without collapsing the state, returning {integer_outcome: count}; the first listed qubit is the least-significant result bit.
- SampleCountsMany(self, qubits: collections.abc.Sequence[int], shots: int = 1000) dict¶
- apply_operator(self, qubits: collections.abc.Sequence[int], matrix: numpy.ndarray[dtype=complex128, shape=(*, *), order='F'], normalize: bool = False) None¶
- density_matrix_element_bits(self, row: collections.abc.Sequence[bool], col: collections.abc.Sequence[bool]) complex¶
- expectation_value_operators(self, qubits: collections.abc.Sequence[int], matrices: collections.abc.Sequence[numpy.ndarray[dtype=complex128, shape=(*, *), order='F']]) complex¶
MPS expectation of ordered one-qubit operators; repeated targets are allowed.
- expectation_values(self, paulis: collections.abc.Sequence[str]) list[float]¶
- expectation_values_complex(self, paulis: collections.abc.Sequence[str], normalized: bool = True) list[complex]¶
Batch MPO expectations; normalized=False returns raw traces.
- fidelity_with_statevector(self, statevector: numpy.ndarray[dtype=complex128, shape=(*), order='C']) float¶
- get_density_matrix(self, normalized: bool = True) numpy.ndarray[dtype=complex128, shape=(*, *), order='F']¶
- get_statevector(self) list[complex]¶
Full pure-state amplitudes in logical basis order (q0 is the low bit).
- move_at_beginning_of_chain(self, qubits: collections.abc.Sequence[int]) None¶
- partial_trace(self, qubits: collections.abc.Sequence[int]) numpy.ndarray[dtype=complex128, shape=(*, *), order='F']¶
- probability_bits(self, bits: collections.abc.Sequence[bool]) float¶
- class GateFusionStatistics¶
- property backendGates¶
(self) -> int
- property fusedBlocks¶
(self) -> int
- property submittedGates¶
(self) -> int
- class QasmToCirc(*args, **kwargs)¶
-
- parse_and_translate(self, qasm_str: str, params: collections.abc.Mapping[str, float] = {}) maestro.circuits.QuantumCircuit¶
Parse an OpenQASM string and translate it into a circuit.
- Parameters:
qasm_str – The QASM program text.
params – Optional dict binding QASM3 input declarations (str -> float) at parse time.