diff --git a/specgen/spec/sec-gates.s b/specgen/spec/sec-gates.s index c195506..b6a3404 100644 --- a/specgen/spec/sec-gates.s +++ b/specgen/spec/sec-gates.s @@ -332,7 +332,7 @@ DEFGATE TT p q AS SEQUENCE: T p T q } -@p{The standard gate `CSWAP` (Toffoli) could be defined with the following definition:} +@p{The standard gate @c{CSWAP} (Toffoli) could be defined with the following definition:} @clist{ DEFGATE TOFFOLI p q r AS SEQUENCE: H r @@ -343,7 +343,7 @@ DEFGATE TOFFOLI p q r AS SEQUENCE: CNOT q r DAGGER T r CNOT p r - #Note the use of TT here + # Note the use of TT here TT q r CNOT p q H r @@ -353,8 +353,7 @@ DEFGATE TOFFOLI p q r AS SEQUENCE: } @p{An arbitrary Euler rotation could be expressed as:} -@clist{ - +@clist{ DEFGATE EULER(%alpha, %beta, %gamma) p AS SEQUENCE: RY(%alpha) p RZ(%beta) p diff --git a/specgen/spec/sec-structure.s b/specgen/spec/sec-structure.s index 974dd24..99fd734 100644 --- a/specgen/spec/sec-structure.s +++ b/specgen/spec/sec-structure.s @@ -206,7 +206,7 @@ associativity directions. @syntax[:name "Term"]{ - @ms{Expression} - @alt @ms{Identifier} ( @ms{Expression} ) + @alt @ms{Function Expression} @alt ( @ms{Expression} ) @alt @ms{Complex} @alt @ms{Parameter} @@ -230,6 +230,28 @@ enough to warrant their own production.} } } +@p{This allows us to specify the @ms{Function Expression}.} + +@syntax[:name "Function Expression"]{ + @ms{Function Name} ( @ms{Expression List} ) +} + + +@subsubsection[:title "Functions in Arithmetic Expressions"] + +@p{The following functions are allowed to be used in function +expressions.} + +@syntax[:name "Function Name"]{ + @ms{Trigonometric Function Name} + @alt @ms{Inverse Trigonometric Function Name} + @alt @ms{Algebraic Function Name} + SIN | COS | TAN | ASIN | ACOS | ATAN | SQRT | ATAN2 +} + +@p{All functions listed take on their usual definitions over the +complex numbers.} + @subsection[:title "Main Program Elements"] @p{A Quil program consists of declarations, directives, and