logo

Common _QPE_U_t_circuit 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_circuit
In [2]:
# check that the built expression is the same as the stored expression
assert _QPE_U_t_circuit == stored_expr
assert _QPE_U_t_circuit._style_id == stored_expr._style_id
print("Passed sanity check: _QPE_U_t_circuit matches stored_expr")
Passed sanity check: _QPE_U_t_circuit 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}_1\left(U, t\right)} & \gate{{\mathrm {FT}}^{\dag}_{t}} & { /^{t} } \qw \\
& \ghost{\textrm{QPE}_1\left(U, t\right)} & { /^{s} } \qw & { /^{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
operands: 2
1Literal
2ExprTuple3, 4
3ExprTuple5, 6
4ExprTuple7, 8
5ExprRangelambda_map: 9
start_index: 37
end_index: 46
6ExprRangelambda_map: 9
start_index: 10
end_index: 34
7ExprRangelambda_map: 11
start_index: 37
end_index: 46
8ExprRangelambda_map: 12
start_index: 37
end_index: 45
9Lambdaparameter: 36
body: 13
10Operationoperator: 40
operands: 14
11Lambdaparameter: 36
body: 15
12Lambdaparameter: 36
body: 17
13Operationoperator: 19
operands: 18
14ExprTuple46, 37
15Operationoperator: 19
operands: 20
16ExprTuple36
17Operationoperator: 29
operands: 21
18NamedExprselement: 22
targets: 23
19Literal
20NamedExprselement: 24
targets: 25
21NamedExprsoperation: 26
22Operationoperator: 29
operands: 27
23Operationoperator: 31
operands: 28
24Operationoperator: 29
operands: 30
25Operationoperator: 31
operands: 32
26Literal
27NamedExprsoperation: 33
part: 36
28ExprTuple37, 34
29Literal
30NamedExprsoperation: 35
part: 36
31Literal
32ExprTuple37, 46
33Operationoperator: 38
operands: 39
34Operationoperator: 40
operands: 41
35Operationoperator: 42
operand: 46
36Variable
37Literal
38Literal
39ExprTuple44, 46
40Literal
41ExprTuple46, 45
42Literal
43ExprTuple46
44Literal
45Literal
46Literal