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§

source

fn tags(&self) -> &'static [&'static str]

Returns tags classifying the type of the operation.

Used for type based dispatch in ffi interfaces.

source

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.

source

fn is_parametrized(&self) -> bool

Returns true when operation has symbolic parameters.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Operate for ConstantGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Definition

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for GateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ModeGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MultiQubitGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MultiQubitOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Operation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaNoiseOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaNoiseProbaOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Rotation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleModeGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleModeOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleQubitGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleQubitOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SpinsAnalogOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ThreeQubitGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ThreeQubitOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for TwoModeGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for TwoModeOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for TwoQubitGateOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for TwoQubitOperation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for CZQubitResonator

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for JaynesCummings

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for LongitudinalCoupling

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for QuantumRabi

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleExcitationLoad

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleExcitationStore

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for BeamSplitter

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Bogoliubov

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for CNOT

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ComplexPMInteraction

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledControlledPauliZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledControlledPhaseShift

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledPauliY

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledPauliZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledPhaseShift

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledRotateX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ControlledRotateXY

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for DefinitionBit

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for DefinitionComplex

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for DefinitionFloat

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for DefinitionUsize

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for EchoCrossResonance

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for FSwap

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Fsim

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for GPi2

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for GPi

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for GivensRotation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for GivensRotationLittleEndian

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Hadamard

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for ISwap

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Identity

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for InputBit

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for InputSymbolic

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for InvSqrtISwap

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for InvSqrtPauliX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MeasureQubit

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MolmerSorensenXX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MultiQubitMS

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for MultiQubitZZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PMInteraction

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PauliX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PauliY

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PauliZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseDisplacement

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseShift

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseShiftState0

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseShiftState1

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseShiftedControlledPhase

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhaseShiftedControlledZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PhotonDetection

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaActiveReset

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaAnnotatedOp

source§

impl Operate for PragmaBoostNoise

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaChangeDevice

source§

impl Operate for PragmaConditional

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaControlledCircuit

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaDamping

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaDephasing

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaDepolarising

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGeneralNoise

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGetDensityMatrix

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGetOccupationProbability

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGetPauliProduct

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGetStateVector

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaGlobalPhase

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaLoop

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaOverrotation

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaRandomNoise

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaRepeatGate

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaRepeatedMeasurement

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaSetDensityMatrix

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaSetNumberOfMeasurements

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaSetStateVector

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaSleep

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaStartDecompositionBlock

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaStopDecompositionBlock

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for PragmaStopParallelBlock

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Qsim

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for RotateAroundSphericalAxis

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for RotateX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for RotateXY

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for RotateY

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for RotateZ

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SGate

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SWAP

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SingleQubitGate

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SpinInteraction

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SqrtISwap

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for SqrtPauliX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Squeezing

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for TGate

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for Toffoli

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for VariableMSXX

Implements the universal basic trait Operate for this Operation.

source§

impl Operate for XY

Implements the universal basic trait Operate for this Operation.