Trait roqoqo::operations::Operate
source · pub trait Operate: InvolveQubits + Substitute + Clone + Debug + Send + SupportedVersion {
// Required methods
fn tags(&self) -> &'static [&'static str];
fn hqslang(&self) -> &'static str;
fn is_parametrized(&self) -> bool;
}
Expand description
Universal basic trait for all operations of roqoqo.
§Example
use roqoqo::operations::{Operate, PauliX, RotateZ};
use qoqo_calculator::CalculatorFloat;
let paulix = PauliX::new(0);
let gate_tags: &[&str; 4] = &[
"Operation",
"GateOperation",
"SingleQubitGateOperation",
"PauliX",
];
// 1) The tags of the operation tell us what kind of operation it is, and what traits it implements
assert_eq!(paulix.tags(), gate_tags);
// 2) The name of the operation is given by hqslang
assert_eq!(paulix.hqslang(), "PauliX");
// 3) Whether a gate is parametrized is determined by whether any of its inputs are symbolic (CalculatorFloat with a string).
// As the PauliX gate only takes an integer input (qubit), it can never be parametrized.
assert!(!paulix.is_parametrized());
// However, a RotateZ gate can be parametrized:
let rotatez_param = RotateZ::new(0, CalculatorFloat::from("parametrized"));
assert!(rotatez_param.is_parametrized());
// But it can also not be parametrized:
let rotatez_not_param = RotateZ::new(0, CalculatorFloat::from(2.0));
assert!(!rotatez_not_param.is_parametrized());
Required Methods§
Returns tags classifying the type of the operation.
Used for type based dispatch in ffi interfaces.
sourcefn hqslang(&self) -> &'static str
fn hqslang(&self) -> &'static str
Returns hqslang name of the operation.
As a general rule that should correspond to the roqoqo name of the operation.
sourcefn is_parametrized(&self) -> bool
fn is_parametrized(&self) -> bool
Returns true
when operation has symbolic parameters.
Object Safety§
Implementors§
impl Operate for ConstantGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for Definition
Implements the universal basic trait Operate for this Operation.
impl Operate for GateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for ModeGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for MultiQubitGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for MultiQubitOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for Operation
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaNoiseOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaNoiseProbaOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for Rotation
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleModeGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleModeOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleQubitGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleQubitOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for SpinsAnalogOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for ThreeQubitGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for ThreeQubitOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for TwoModeGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for TwoModeOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for TwoQubitGateOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for TwoQubitOperation
Implements the universal basic trait Operate for this Operation.
impl Operate for CZQubitResonator
Implements the universal basic trait Operate for this Operation.
impl Operate for JaynesCummings
Implements the universal basic trait Operate for this Operation.
impl Operate for LongitudinalCoupling
Implements the universal basic trait Operate for this Operation.
impl Operate for QuantumRabi
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleExcitationLoad
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleExcitationStore
Implements the universal basic trait Operate for this Operation.
impl Operate for BeamSplitter
Implements the universal basic trait Operate for this Operation.
impl Operate for Bogoliubov
Implements the universal basic trait Operate for this Operation.
impl Operate for CNOT
Implements the universal basic trait Operate for this Operation.
impl Operate for ComplexPMInteraction
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledControlledPauliZ
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledControlledPhaseShift
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledPauliY
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledPauliZ
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledPhaseShift
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledRotateX
Implements the universal basic trait Operate for this Operation.
impl Operate for ControlledRotateXY
Implements the universal basic trait Operate for this Operation.
impl Operate for DefinitionBit
Implements the universal basic trait Operate for this Operation.
impl Operate for DefinitionComplex
Implements the universal basic trait Operate for this Operation.
impl Operate for DefinitionFloat
Implements the universal basic trait Operate for this Operation.
impl Operate for DefinitionUsize
Implements the universal basic trait Operate for this Operation.
impl Operate for EchoCrossResonance
Implements the universal basic trait Operate for this Operation.
impl Operate for FSwap
Implements the universal basic trait Operate for this Operation.
impl Operate for Fsim
Implements the universal basic trait Operate for this Operation.
impl Operate for GPi2
Implements the universal basic trait Operate for this Operation.
impl Operate for GPi
Implements the universal basic trait Operate for this Operation.
impl Operate for GivensRotation
Implements the universal basic trait Operate for this Operation.
impl Operate for GivensRotationLittleEndian
Implements the universal basic trait Operate for this Operation.
impl Operate for Hadamard
Implements the universal basic trait Operate for this Operation.
impl Operate for ISwap
Implements the universal basic trait Operate for this Operation.
impl Operate for Identity
Implements the universal basic trait Operate for this Operation.
impl Operate for InputBit
Implements the universal basic trait Operate for this Operation.
impl Operate for InputSymbolic
Implements the universal basic trait Operate for this Operation.
impl Operate for InvSqrtISwap
Implements the universal basic trait Operate for this Operation.
impl Operate for InvSqrtPauliX
Implements the universal basic trait Operate for this Operation.
impl Operate for MeasureQubit
Implements the universal basic trait Operate for this Operation.
impl Operate for MolmerSorensenXX
Implements the universal basic trait Operate for this Operation.
impl Operate for MultiQubitMS
Implements the universal basic trait Operate for this Operation.
impl Operate for MultiQubitZZ
Implements the universal basic trait Operate for this Operation.
impl Operate for PMInteraction
Implements the universal basic trait Operate for this Operation.
impl Operate for PauliX
Implements the universal basic trait Operate for this Operation.
impl Operate for PauliY
Implements the universal basic trait Operate for this Operation.
impl Operate for PauliZ
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseDisplacement
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseShift
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseShiftState0
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseShiftState1
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseShiftedControlledPhase
Implements the universal basic trait Operate for this Operation.
impl Operate for PhaseShiftedControlledZ
Implements the universal basic trait Operate for this Operation.
impl Operate for PhotonDetection
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaActiveReset
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaAnnotatedOp
impl Operate for PragmaBoostNoise
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaChangeDevice
impl Operate for PragmaConditional
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaControlledCircuit
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaDamping
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaDephasing
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaDepolarising
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGeneralNoise
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGetDensityMatrix
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGetOccupationProbability
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGetPauliProduct
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGetStateVector
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaGlobalPhase
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaLoop
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaOverrotation
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaRandomNoise
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaRepeatGate
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaRepeatedMeasurement
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaSetDensityMatrix
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaSetNumberOfMeasurements
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaSetStateVector
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaSleep
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaStartDecompositionBlock
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaStopDecompositionBlock
Implements the universal basic trait Operate for this Operation.
impl Operate for PragmaStopParallelBlock
Implements the universal basic trait Operate for this Operation.
impl Operate for Qsim
Implements the universal basic trait Operate for this Operation.
impl Operate for RotateAroundSphericalAxis
Implements the universal basic trait Operate for this Operation.
impl Operate for RotateX
Implements the universal basic trait Operate for this Operation.
impl Operate for RotateXY
Implements the universal basic trait Operate for this Operation.
impl Operate for RotateY
Implements the universal basic trait Operate for this Operation.
impl Operate for RotateZ
Implements the universal basic trait Operate for this Operation.
impl Operate for SGate
Implements the universal basic trait Operate for this Operation.
impl Operate for SWAP
Implements the universal basic trait Operate for this Operation.
impl Operate for SingleQubitGate
Implements the universal basic trait Operate for this Operation.
impl Operate for SpinInteraction
Implements the universal basic trait Operate for this Operation.
impl Operate for SqrtISwap
Implements the universal basic trait Operate for this Operation.
impl Operate for SqrtPauliX
Implements the universal basic trait Operate for this Operation.
impl Operate for Squeezing
Implements the universal basic trait Operate for this Operation.
impl Operate for TGate
Implements the universal basic trait Operate for this Operation.
impl Operate for Toffoli
Implements the universal basic trait Operate for this Operation.
impl Operate for VariableMSXX
Implements the universal basic trait Operate for this Operation.
impl Operate for XY
Implements the universal basic trait Operate for this Operation.