19 namespace instruction {
99 const std::string &name,
100 const std::string ¶m_types =
"",
101 bool allow_conditional =
true,
102 bool allow_parallel =
true,
103 bool allow_reused_qubits =
false,
104 bool allow_different_index_sizes =
false 116 return !(*
this == rhs);
138 namespace primitives {
::tree::base::Maybe< T > Maybe
tree::Maybe< Instruction > InstructionRef
Optional reference to an instruction, used within the semantic tree.
std::ostream & operator<<(std::ostream &os, const Instruction &insn)
Stream << overload for instructions.
error_model::ErrorModelRef deserialize(const ::tree::cbor::MapReader &map)
Deserializes the given primitive object from CBOR.
Toplevel namespace with entry points for the new API.
bool allow_reused_qubits
Whether to allow usage of the same qubit in different arguments.
bool allow_conditional
Whether this instruction supports conditional execution by means of the c- notation.
Defines classes representing the values (collective name for constants, references, and dynamically evaluated expressions) available within cQASM's type system, as well as some utility functions.
bool allow_parallel
Whether this instruction can be used in a bundle.
void serialize(const error_model::ErrorModelRef &obj, ::tree::cbor::MapWriter &map)
Representation of an available instruction (also known as gate) in the instruction set...
bool operator==(const Instruction &rhs) const
Equality operator.
types::Types param_types
The vector of parameter types that this instruction expects.
Namespace for the "new" cQASM 1.x API.
Instruction(const std::string &name, const std::string ¶m_types="", bool allow_conditional=true, bool allow_parallel=true, bool allow_reused_qubits=false, bool allow_different_index_sizes=false)
Creates a new instruction.
tree::Any< TypeBase > Types
Zero or more cQASM types.
bool operator!=(const Instruction &rhs) const
Inequality operator.
Defines the types of values available within cQASM's type system, as well as some utility functions...
bool allow_different_index_sizes
Whether different index sizes are allowed.
std::string name
The name of the instruction.