MeasurementPlaceholder
- class MeasurementPlaceholder(classical_regs, measurements)[source]
Bases:
Gate
Pseudogate to hold measurement information.
- __init__(classical_regs, measurements)[source]
Construct a MeasurementPlaceholder.
- Parameters:
classical_regs (
list[tuple[str, int]]
) – A list of classical register descriptors. Each one is given as a tuple containing its name and size.measurements (
dict[int, tuple[str, int]]
) – A list of measurements made. Measurements are given as a map of qudit index to a tuple containing the classical register’s name and index.
Attributes
The matrix dimension for this unitary.
The name of this gate.
The number of real parameters this unitary-valued function takes.
The number of qudits this unitary can act on.
The qasm identifier for this gate.
The number of orthogonal states for each qudit.
Methods
check_parameters
(params)Check parameters are valid and match the unitary.
Return the gate's inverse as a gate.
get_inverse_params
([params])Return the parameters that invert the gate.
get_qasm
(params, location)Returns the qasm string for this gate.
Declares the classical registers.
get_unitary
([params])Map real-valued params to a UnitaryMatrix.
Return true if this unitary doesn't take parameters.
Return true if this unitary is parameterized.
Return true if this unitary can only act on qubits.
is_qudit_only
(radix)Return true if this unitary can only act on radix-qudits.
Return true if this unitary can only act on qutrits.
is_self_inverse
([params])Checks whether the unitary is its own inverse.
with_all_frozen_params
(params)Freeze all of a gate's parameters so they don't change from optimization.
with_frozen_params
(frozen_params)Freeze some of a gate's parameters so they don't change from optimization.