| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Traq.CQPL.Syntax
Synopsis
- data MetaParam size
- data Arg size
- = Arg Ident
- | ArrElemArg (Arg size) (MetaParam size)
- class HasAdjoint a where
- adjoint :: a -> a
- data BasicGate
- data Unitary size
- data UStmt size
- = USkipS
- | UnitaryS { }
- | UCallS { }
- | USeqS [UStmt size]
- | UCommentS String
- | URepeatS {
- n_iter :: MetaParam size
- uloop_body :: UStmt size
- | UForInRangeS {
- iter_meta_var :: Ident
- iter_lim :: MetaParam size
- dagger :: Bool
- uloop_body :: UStmt size
- | UForInDomainS {
- iter_meta_var :: Ident
- iter_ty :: VarType size
- dagger :: Bool
- uloop_body :: UStmt size
- | UWithComputedS {
- with_ustmt, body_ustmt :: UStmt size
- data FunctionCall
- data Stmt size
- = SkipS
- | CommentS String
- | AssignS { }
- | RandomS {
- rets :: [Ident]
- distr_expr :: DistrExpr size
- | RandomDynS { }
- | CallS {
- fun :: FunctionCall
- meta_params :: [Either (MetaParam size) Ident]
- args :: [Arg size]
- | SeqS [Stmt size]
- | IfThenElseS { }
- | RepeatS { }
- | WhileK { }
- | WhileKWithCondExpr { }
- | ForInArray {
- loop_index :: Ident
- loop_index_ty :: VarType size
- loop_values :: [BasicExpr size]
- loop_body :: Stmt size
- | ForInRangeS { }
- data ParamTag
- data UProcBody size
- = UProcBody {
- uproc_param_names :: [Ident]
- uproc_param_tags :: [ParamTag]
- uproc_body_stmt :: UStmt size
- | UProcDecl
- = UProcBody {
- data CProcBody size
- = CProcBody {
- cproc_param_names :: [Ident]
- cproc_local_vars :: [(Ident, VarType size)]
- cproc_body_stmt :: Stmt size
- | CProcDecl
- = CProcBody {
- data ProcBody size
- data ProcDef size = ProcDef {
- info_comment :: String
- proc_name :: Ident
- proc_meta_params :: [Ident]
- proc_param_types :: [VarType size]
- proc_body :: ProcBody size
- type ProcCtx size = Context (ProcDef size)
- newtype Program size = Program [ProcDef size]
- ifThenS :: Ident -> Stmt size -> Stmt size
- mkForInRangeS :: Ident -> MetaParam size -> UStmt size -> UStmt size
- desugarS :: CanDesugar p => p -> Maybe p
- class HasProcCtx s where
- isUProc :: ClassifyProc p => p -> Bool
- isCProc :: ClassifyProc p => p -> Bool
Syntax
Compile-time constant parameters
An argument (to ops/procs)
Constructors
| Arg Ident | |
| ArrElemArg (Arg size) (MetaParam size) |
Unitary Fragment
class HasAdjoint a where #
Instances
| HasAdjoint BasicGate # | |
Defined in Traq.CQPL.Syntax | |
| HasAdjoint (UStmt size) # | |
Defined in Traq.CQPL.Syntax | |
| HasAdjoint (Unitary size) # | |
Defined in Traq.CQPL.Syntax | |
Instances
| Read BasicGate # | |
| Show BasicGate # | |
| Eq BasicGate # | |
| HasAdjoint BasicGate # | |
Defined in Traq.CQPL.Syntax | |
| ToCodeString BasicGate # | |
Defined in Traq.CQPL.Syntax | |
Unitary operators in CQPL
Constructors
| BasicGateU BasicGate | |
| RevEmbedU [Ident] (BasicExpr size) | |
| DistrU (DistrExpr size) | |
| Controlled (Unitary size) | |
| Adjoint (Unitary size) |
Instances
| Read size => Read (Unitary size) # | |
| Show size => Show (Unitary size) # | |
| Eq size => Eq (Unitary size) # | |
| HasAdjoint (Unitary size) # | |
Defined in Traq.CQPL.Syntax | |
| Show size => ToCodeString (Unitary size) # | |
Defined in Traq.CQPL.Syntax | |
| type SizeType (Unitary size) # | |
Defined in Traq.CQPL.Syntax | |
Unitary Statement
Constructors
| USkipS | |
| UnitaryS | |
| UCallS | |
| USeqS [UStmt size] | |
| UCommentS String | |
| URepeatS | |
Fields
| |
| UForInRangeS | |
Fields
| |
| UForInDomainS | |
Fields
| |
| UWithComputedS | |
Fields
| |
Instances
| Read size => Read (UStmt size) # | |
| Show size => Show (UStmt size) # | |
| Eq size => Eq (UStmt size) # | |
| HasAdjoint (UStmt size) # | |
Defined in Traq.CQPL.Syntax | |
| Show size => ToCodeString (UStmt size) # | |
Defined in Traq.CQPL.Syntax | |
| type SizeType (UStmt size) # | |
Defined in Traq.CQPL.Syntax | |
Classical Fragment
data FunctionCall #
Type of function call
Constructors
| FunctionCall Ident | |
| UProcAndMeas Ident |
Instances
| Read FunctionCall # | |
Defined in Traq.CQPL.Syntax Methods readsPrec :: Int -> ReadS FunctionCall # readList :: ReadS [FunctionCall] # | |
| Show FunctionCall # | |
Defined in Traq.CQPL.Syntax Methods showsPrec :: Int -> FunctionCall -> ShowS # show :: FunctionCall -> String # showList :: [FunctionCall] -> ShowS # | |
| Eq FunctionCall # | |
Defined in Traq.CQPL.Syntax | |
CQ Statement
Constructors
| SkipS | |
| CommentS String | |
| AssignS | |
| RandomS | |
Fields
| |
| RandomDynS | |
| CallS | |
Fields
| |
| SeqS [Stmt size] | |
| IfThenElseS | |
| RepeatS | |
| WhileK | |
| WhileKWithCondExpr | |
| ForInArray | |
Fields
| |
| ForInRangeS | |
Instances
| Read size => Read (Stmt size) # | |
| Show size => Show (Stmt size) # | |
| Eq size => Eq (Stmt size) # | |
| HasAst (Stmt size) # | |
Defined in Traq.CQPL.Syntax Methods _ast :: Traversal' (Stmt size) (Stmt size) # | |
| HasStmt (Stmt size) # | |
Defined in Traq.CQPL.Syntax | |
| Show size => ToCodeString (Stmt size) # | |
Defined in Traq.CQPL.Syntax | |
| type SizeType (Stmt size) # | |
Defined in Traq.CQPL.Syntax | |
| type StmtOf (Stmt size) # | |
Defined in Traq.CQPL.Syntax | |
Procedures
Instances
| Enum ParamTag # | |
| Read ParamTag # | |
| Show ParamTag # | |
| Eq ParamTag # | |
| ToCodeString ParamTag # | |
Defined in Traq.CQPL.Syntax | |
Unitary Procedure body: either a statement (with parameter name bindings) or a tick.
Constructors
| UProcBody | |
Fields
| |
| UProcDecl | |
Classical Procedure body: either a tick, or statement with bindings for parameters names, and optionally using local variables.
Constructors
| CProcBody | |
Fields
| |
| CProcDecl | |
Constructors
| ProcDef | |
Fields
| |
Instances
| Read size => Read (ProcDef size) # | |
| Show size => Show (ProcDef size) # | |
| Eq size => Eq (ProcDef size) # | |
| HasProcCtx (ProcCtx size) # | |
| HasStmt (ProcDef size) # | |
Defined in Traq.CQPL.Syntax | |
| Show size => ToCodeString (ProcDef size) # | |
Defined in Traq.CQPL.Syntax | |
| type SizeType (ProcDef size) # | |
Defined in Traq.CQPL.Syntax | |
| type StmtOf (ProcDef size) # | |
Defined in Traq.CQPL.Syntax | |
Program
CQ Program
Instances
| Read size => Read (Program size) # | |
| Show size => Show (Program size) # | |
| Eq size => Eq (Program size) # | |
| HasStmt (Program size) # | |
Defined in Traq.CQPL.Syntax | |
| Show size => ToCodeString (Program size) # | |
Defined in Traq.CQPL.Syntax | |
| type SizeType (Program size) # | |
Defined in Traq.CQPL.Syntax | |
| type StmtOf (Program size) # | |
Defined in Traq.CQPL.Syntax | |
Syntax Sugar
Lenses
class HasProcCtx s where #
Instances
| HasProcCtx (ProcCtx size) # | |
| HasProcCtx (CheckingCtx size) # | |
Defined in Traq.CQPL.TypeCheck Methods _procCtx :: (size0 ~ SizeType (CheckingCtx size), prec ~ PrecType (CheckingCtx size)) => Lens' (CheckingCtx size) (ProcCtx size0) # | |