Enum qasm::AstNode
[−]
[src]
pub enum AstNode { QReg(String, i32), CReg(String, i32), Barrier(Argument), Reset(Argument), Measure(Argument, Argument), ApplyGate(String, Vec<Argument>, Vec<String>), Opaque(String, Vec<Argument>, Vec<String>), Gate(String, Vec<String>, Vec<String>, Vec<AstNode>), If(String, i32, Box<AstNode>), }
AST Nodes. These can pattern matched to evaluate the ast.
The nodes are representative of what operation should be done, please look at their documentation.
Variants
QReg(String, i32)
Represents the initialization of a Quantum Register. The String is the identifier, and the integer is the number of qubits.
CReg(String, i32)
Represents the initialization of a Classical Register. The String is the identifier, and the integer is the number of qubits.
Barrier(Argument)
Represents a barrier to a qubit / register
Reset(Argument)
Represents reseting a qubit / register
Measure(Argument, Argument)
Representing measuremnt of a qubit/register to a bit/register
ApplyGate(String, Vec<Argument>, Vec<String>)
Represents application of a gate String is the name of the gate. The first arguments is the qubits that the gates are being applied to The second is the parameters (mathematical expressions). Note the mathematic expressions are strings, and must be evaluated
Opaque(String, Vec<Argument>, Vec<String>)
Represents an opaque gate String is the name of the gate. The first arguments is the qubits that the gates are being applied to The second is the parameters (mathematical expressions)
Gate(String, Vec<String>, Vec<String>, Vec<AstNode>)
Represents the creation of a gate String is the name of the gate The first is the qubits it acts on, The seconds is the ids of the params. finally, a list of nodes, which the gate applies
If(String, i32, Box<AstNode>)
Represents a conditional String is classical register i32 is the value to to check if equal. If equal, AstNode is applied.
Trait Implementations
impl Debug for AstNode
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialEq for AstNode
[src]
fn eq(&self, __arg_0: &AstNode) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AstNode) -> bool
[src]
This method tests for !=
.