Namespace qasm3

namespace qasm3

Typedefs

typedef Type<uint64_t> ResolvedType
using TypeExpr = Type<std::shared_ptr<Expression>>

Enums

enum DesignatedTy

Values:

enumerator Qubit
enumerator Bit
enumerator Int
enumerator Uint
enumerator Float
enumerator Angle
enum UnsizedTy

Values:

enumerator Bool
enumerator Duration

Functions

std::optional<qc::ComparisonKind> getComparisonKind(BinaryExpression::Op op)

Variables

const std::string STDGATES  ="// four parameter controlled-U gate with relative phase\n""gate cu(theta, phi, lambda, gamma) c, t { p(gamma) c; ctrl @ U(theta, ""phi, lambda) c, t; }\n"
const std::string QE1LIB  = "gate rccx a, b, c {\n""  u2(0, pi) c; u1(pi/4) c; \n""  cx b, c; u1(-pi/4) c; \n""  cx a, c; u1(pi/4) c; \n""  cx b, c; u1(-pi/4) c; \n""  u2(0, pi) c; \n""}\n""gate rc3x a,b,c,d {\n""  u2(0,pi) d; u1(pi/4) d; \n""  cx c,d; u1(-pi/4) d; u2(0,pi) d; \n""  cx a,d; u1(pi/4) d; \n""  cx b,d; u1(-pi/4) d; \n""  cx a,d; u1(pi/4) d; \n""  cx b,d; u1(-pi/4) d; \n""  u2(0,pi) d; u1(pi/4) d; \n""  cx c,d; u1(-pi/4) d; \n""  u2(0,pi) d; \n""}\n"
const std::map<std::string, std::shared_ptr<Gate>> STANDARD_GATES
template<typename T>
class ArrayType : public qasm3::Type<T>
class AssignmentStatement : public qasm3::Statement, public std::enable_shared_from_this<AssignmentStatement>
class BarrierStatement : public qasm3::QuantumStatement, public std::enable_shared_from_this<BarrierStatement>
class BinaryExpression : public qasm3::Expression, public std::enable_shared_from_this<BinaryExpression>
class CompilerError : public std::exception
class CompilerPass

Subclassed by qasm3::const_eval::ConstEvalPass, qasm3::type_checking::TypeCheckPass

struct CompoundGate : public qasm3::Gate
class Constant : public qasm3::Expression
class ConstEvalError : public std::exception
class CtrlGateModifier : public qasm3::GateModifier, public std::enable_shared_from_this<CtrlGateModifier>
struct DebugInfo
class DeclarationExpression
class DeclarationStatement : public qasm3::Statement, public std::enable_shared_from_this<DeclarationStatement>
class DefaultInstVisitor : public qasm3::InstVisitor

Subclassed by qasm3::const_eval::ConstEvalPass

template<typename T>
class DesignatedType : public qasm3::Type<T>
class Expression

Subclassed by qasm3::BinaryExpression, qasm3::Constant, qasm3::GateOperand, qasm3::IdentifierExpression, qasm3::IdentifierList, qasm3::IndexedIdentifier, qasm3::MeasureExpression, qasm3::UnaryExpression

template<typename T>
class ExpressionVisitor
struct Gate

Subclassed by qasm3::CompoundGate, qasm3::StandardGate

class GateCallStatement : public qasm3::QuantumStatement, public std::enable_shared_from_this<GateCallStatement>
class GateDeclaration : public qasm3::Statement, public std::enable_shared_from_this<GateDeclaration>
struct GateInfo
class GateModifier : public std::enable_shared_from_this<GateModifier>

Subclassed by qasm3::CtrlGateModifier, qasm3::InvGateModifier, qasm3::PowGateModifier

class GateOperand : public qasm3::Expression, public std::enable_shared_from_this<GateOperand>
class IdentifierExpression : public qasm3::Expression, public std::enable_shared_from_this<IdentifierExpression>
class IdentifierList : public qasm3::Expression, public std::enable_shared_from_this<IdentifierList>
class IfStatement : public qasm3::Statement, public std::enable_shared_from_this<IfStatement>
class Importer : public qasm3::InstVisitor

Public Static Functions

static auto importf(const std::string &filename) -> qc::QuantumComputation

Imports a QASM3 file into a qc::QuantumComputation instance

Parameters:

filename – The path to the QASM3 file to import

Returns:

The imported qc::QuantumComputation instance

static auto imports(const std::string &qasm) -> qc::QuantumComputation

Imports a QASM3 program from a string into a qc::QuantumComputation

Parameters:

qasm – The QASM3 program to import

Returns:

The imported qc::QuantumComputation instance

static auto import(std::istream &is) -> qc::QuantumComputation

Imports a QASM3 program from a stream into a qc::QuantumComputation

Parameters:

is – The input stream to read the QASM3 program from

Returns:

The imported qc::QuantumComputation instance

class IndexedIdentifier : public qasm3::Expression, public std::enable_shared_from_this<IndexedIdentifier>
class IndexOperator
class InitialLayout : public qasm3::Statement, public std::enable_shared_from_this<InitialLayout>
class InstVisitor

Subclassed by qasm3::DefaultInstVisitor, qasm3::Importer, qasm3::type_checking::TypeCheckPass

class InvGateModifier : public qasm3::GateModifier, public std::enable_shared_from_this<InvGateModifier>
class MeasureExpression : public qasm3::Expression, public std::enable_shared_from_this<MeasureExpression>
template<typename T>
class NestedEnvironment
class OutputPermutation : public qasm3::Statement, public std::enable_shared_from_this<OutputPermutation>
class Parser
class PowGateModifier : public qasm3::GateModifier, public std::enable_shared_from_this<PowGateModifier>
class QuantumStatement : public qasm3::Statement

Subclassed by qasm3::BarrierStatement, qasm3::GateCallStatement, qasm3::ResetStatement

class ResetStatement : public qasm3::QuantumStatement, public std::enable_shared_from_this<ResetStatement>
class Scanner
struct StandardGate : public qasm3::Gate
class Statement

Subclassed by qasm3::AssignmentStatement, qasm3::DeclarationStatement, qasm3::GateDeclaration, qasm3::IfStatement, qasm3::InitialLayout, qasm3::OutputPermutation, qasm3::QuantumStatement, qasm3::VersionDeclaration

struct Token
template<typename T>
class Type

Subclassed by qasm3::ArrayType< T >, qasm3::DesignatedType< T >, qasm3::UnsizedType< T >

class TypeCheckError : public std::exception
template<typename T>
class TypeVisitor
class UnaryExpression : public qasm3::Expression, public std::enable_shared_from_this<UnaryExpression>
template<typename T>
class UnsizedType : public qasm3::Type<T>
class VersionDeclaration : public qasm3::Statement, public std::enable_shared_from_this<VersionDeclaration>
namespace const_eval
class ConstEvalPass : public qasm3::CompilerPass, public qasm3::DefaultInstVisitor, public qasm3::ExpressionVisitor<std::optional<ConstEvalValue>>, public qasm3::TypeVisitor<std::shared_ptr<Expression>>
struct ConstEvalValue
namespace type_checking
struct InferredType
class TypeCheckPass : public qasm3::CompilerPass, public qasm3::InstVisitor, public qasm3::ExpressionVisitor<InferredType>