pub enum Operation {
U(f32, f32, f32, Qubit),
CX(Qubit, Qubit),
Custom(String, Vec<f32>, Vec<Qubit>),
Measure(Qubit, Cbit),
ResetQ(Qubit),
ResetC(Cbit),
}
Expand description
An operation to run when running an openqasm program.
Variants§
U(f32, f32, f32, Qubit)
The general unary gate supported by openqasm. Takes 3 parameters an a qubit target.
CX(Qubit, Qubit)
The CX/CNot gate. The first argument is the control bit, and the second is the target.
Custom(String, Vec<f32>, Vec<Qubit>)
A custom gate defined in the openqasm program. Contains the name of the gate, the parameters used when calling the gate, and the qubit targets. When returned from OpenQASMProgram::from_ast it is guaranteed that there is a gate matching the name given in the first field. This gate is also guaranteed to take as many parameters and arguments as is stored in this datatype.
Measure(Qubit, Cbit)
Operation for measuring a qubit onto a classical bit.
ResetQ(Qubit)
Operation for reseting a qubit to its zero state |0>.
ResetC(Cbit)
Operation for reseting a classical bit to its zero state 0.