mirror of https://github.com/openqasm/openqasm.git
95 lines
1.7 KiB
YAML
95 lines
1.7 KiB
YAML
# indent w/ 2 spaces
|
|
source: |
|
|
qubit q;
|
|
gate g q {}
|
|
ctrl(2) @ g q;
|
|
negctrl(3) @ g q;
|
|
pow(-1./2.) @ g q;
|
|
inv @ g q;
|
|
reference: |
|
|
program
|
|
statementOrScope
|
|
statement
|
|
quantumDeclarationStatement
|
|
qubitType
|
|
qubit
|
|
q
|
|
;
|
|
statementOrScope
|
|
statement
|
|
gateStatement
|
|
gate
|
|
g
|
|
identifierList
|
|
q
|
|
scope
|
|
{
|
|
}
|
|
statementOrScope
|
|
statement
|
|
gateCallStatement
|
|
gateModifier
|
|
ctrl
|
|
(
|
|
expression
|
|
2
|
|
)
|
|
@
|
|
g
|
|
gateOperandList
|
|
gateOperand
|
|
indexedIdentifier
|
|
q
|
|
;
|
|
statementOrScope
|
|
statement
|
|
gateCallStatement
|
|
gateModifier
|
|
negctrl
|
|
(
|
|
expression
|
|
3
|
|
)
|
|
@
|
|
g
|
|
gateOperandList
|
|
gateOperand
|
|
indexedIdentifier
|
|
q
|
|
;
|
|
statementOrScope
|
|
statement
|
|
gateCallStatement
|
|
gateModifier
|
|
pow
|
|
(
|
|
expression
|
|
expression
|
|
-
|
|
expression
|
|
1.
|
|
/
|
|
expression
|
|
2.
|
|
)
|
|
@
|
|
g
|
|
gateOperandList
|
|
gateOperand
|
|
indexedIdentifier
|
|
q
|
|
;
|
|
statementOrScope
|
|
statement
|
|
gateCallStatement
|
|
gateModifier
|
|
inv
|
|
@
|
|
g
|
|
gateOperandList
|
|
gateOperand
|
|
indexedIdentifier
|
|
q
|
|
;
|
|
<EOF>
|