logo

Common _QPE_U_t of type Qcircuit

from the theory of proveit.physics.quantum.QPE

In [1]:
import proveit
# Automation is not needed when only building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import the special expression
from proveit.physics.quantum.QPE import _QPE_U_t
In [2]:
# check that the built expression is the same as the stored expression
assert _QPE_U_t == stored_expr
assert _QPE_U_t._style_id == stored_expr._style_id
print("Passed sanity check: _QPE_U_t matches stored_expr")
Passed sanity check: _QPE_U_t matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\begin{array}{c} \Qcircuit@C=1em @R=.7em{
& \multigate{1}{\textrm{QPE}\left(U, t\right)} & { /^{t} } \qw \\
& \ghost{\textrm{QPE}\left(U, t\right)} & { /^{s} } \qw
} \end{array}
In [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
spacingchange the spacing of a circuit using the format '@C=1em @R=.7em' where C is the column spacing and R is the row spacing@C=1em @R=.7em@C=1em @R=.7em
In [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 1
operand: 3
1Literal
2ExprTuple3
3ExprTuple4, 5
4ExprRangelambda_map: 6
start_index: 21
end_index: 28
5ExprRangelambda_map: 6
start_index: 7
end_index: 22
6Lambdaparameter: 20
body: 9
7Operationoperator: 25
operands: 10
8ExprTuple20
9Operationoperator: 11
operands: 12
10ExprTuple28, 21
11Literal
12NamedExprselement: 13
targets: 14
13Operationoperator: 15
operands: 16
14Operationoperator: 17
operands: 18
15Literal
16NamedExprsoperation: 19
part: 20
17Literal
18ExprTuple21, 22
19Operationoperator: 23
operands: 24
20Variable
21Literal
22Operationoperator: 25
operands: 26
23Literal
24ExprTuple27, 28
25Literal
26ExprTuple28, 29
27Literal
28Literal
29Literal