Trait roqoqo::operations::Rotate[][src]

pub trait Rotate: OperateGate + Operate + InvolveQubits + Substitute + Clone + PartialEq {
    fn theta(&self) -> &CalculatorFloat;
fn powercf(&self, power: CalculatorFloat) -> Self; }
Expand description

Trait for unitary operations corresponding to rotations that can be characteriszed by a single rotation parameter theta.

Example

use qoqo_calculator::CalculatorFloat;
use roqoqo::operations::{Rotate, RotateX};
let rotatex = RotateX::new(0, 2.0.into());

// 1) The angle of rotation of the Rotate Operation
assert_eq!(rotatex.theta(), &CalculatorFloat::from(2.0));
// 2) The power function applied to the Rotate Operation
assert_eq!(rotatex.powercf(CalculatorFloat::from(1.5)), RotateX::new(0, 3.0.into()));

Required methods

Returns rotation parameter theta.

Returns the gate to the power of power.`

Implementors