pub trait Operate: InvolveQubits + Substitute + Clone + Debug + Send {
    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.

Returns hqslang name of the operation.

As a general rule that should correspond to the roqoqo name of the operation.

Returns true when operation has symbolic parameters.

Implementors

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.

Implements the universal basic trait Operate for this Operation.