logo

Common _psi_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 _psi_t_circuit
In [2]:
# check that the built expression is the same as the stored expression
assert _psi_t_circuit == stored_expr
assert _psi_t_circuit._style_id == stored_expr._style_id
print("Passed sanity check: _psi_t_circuit matches stored_expr")
Passed sanity check: _psi_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{
\qin{\lvert + \rangle} & \multigate{4}{\textrm{QPE}_1\left(U, t\right)} & \multiqout{3}{\lvert \psi_{t} \rangle} \\
\qin{\lvert + \rangle} & \ghost{\textrm{QPE}_1\left(U, t\right)} & \ghostqout{\lvert \psi_{t} \rangle} \\
\qin{\begin{array}{c}:\\ \left(t - 3\right) \times \\:\end{array}} & \ghost{\textrm{QPE}_1\left(U, t\right)} & \ghostqout{\lvert \psi_{t} \rangle} \\
\qin{\lvert + \rangle} & \ghost{\textrm{QPE}_1\left(U, t\right)} & \ghostqout{\lvert \psi_{t} \rangle} \\
\qin{\lvert u \rangle} & \ghost{\textrm{QPE}_1\left(U, t\right)} & \qout{\lvert u \rangle}
} \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, 5
3ExprTuple6, 7
4ExprTuple8, 9
5ExprTuple10, 11
6ExprRangelambda_map: 12
start_index: 65
end_index: 66
7ExprRangelambda_map: 13
start_index: 65
end_index: 67
8ExprRangelambda_map: 14
start_index: 65
end_index: 66
9ExprRangelambda_map: 14
start_index: 54
end_index: 55
10ExprRangelambda_map: 15
start_index: 65
end_index: 66
11ExprRangelambda_map: 16
start_index: 65
end_index: 67
12Lambdaparameter: 53
body: 17
13Lambdaparameter: 53
body: 18
14Lambdaparameter: 53
body: 19
15Lambdaparameter: 53
body: 20
16Lambdaparameter: 53
body: 22
17Operationoperator: 39
operands: 23
18Operationoperator: 27
operands: 24
19Operationoperator: 27
operands: 25
20Operationoperator: 27
operands: 26
21ExprTuple53
22Operationoperator: 27
operands: 28
23NamedExprsstate: 29
24NamedExprselement: 30
targets: 36
25NamedExprselement: 31
targets: 32
26NamedExprselement: 33
targets: 34
27Literal
28NamedExprselement: 35
targets: 36
29Operationoperator: 37
operand: 49
30Operationoperator: 39
operands: 46
31Operationoperator: 40
operands: 41
32Operationoperator: 47
operands: 42
33Operationoperator: 45
operands: 43
34Operationoperator: 47
operands: 44
35Operationoperator: 45
operands: 46
36Operationoperator: 47
operands: 48
37Literal
38ExprTuple49
39Literal
40Literal
41NamedExprsoperation: 50
part: 53
42ExprTuple65, 55
43NamedExprsstate: 51
part: 53
44ExprTuple65, 66
45Literal
46NamedExprsstate: 52
part: 53
47Literal
48ExprTuple54, 55
49Literal
50Operationoperator: 56
operands: 57
51Operationoperator: 58
operand: 64
52Literal
53Variable
54Operationoperator: 61
operands: 60
55Operationoperator: 61
operands: 62
56Literal
57ExprTuple63, 66
58Literal
59ExprTuple64
60ExprTuple66, 65
61Literal
62ExprTuple66, 67
63Literal
64Variable
65Literal
66Literal
67Literal