logo

Common _Psi_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_circuit
In [2]:
# check that the built expression is the same as the stored expression
assert _Psi_circuit == stored_expr
assert _Psi_circuit._style_id == stored_expr._style_id
print("Passed sanity check: _Psi_circuit matches stored_expr")
Passed sanity check: _Psi_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}\left(U, t\right)} & \multiqout{3}{\lvert \Psi \rangle} \\
\qin{\lvert + \rangle} & \ghost{\textrm{QPE}\left(U, t\right)} & \ghostqout{\lvert \Psi \rangle} \\
\qin{\begin{array}{c}:\\ \left(t - 3\right) \times \\:\end{array}} & \ghost{\textrm{QPE}\left(U, t\right)} & \ghostqout{\lvert \Psi \rangle} \\
\qin{\lvert + \rangle} & \ghost{\textrm{QPE}\left(U, t\right)} & \ghostqout{\lvert \Psi \rangle} \\
\qin{\lvert u \rangle} & \ghost{\textrm{QPE}\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: 62
end_index: 63
7ExprRangelambda_map: 13
start_index: 62
end_index: 64
8ExprRangelambda_map: 14
start_index: 62
end_index: 63
9ExprRangelambda_map: 14
start_index: 54
end_index: 55
10ExprRangelambda_map: 15
start_index: 62
end_index: 63
11ExprRangelambda_map: 16
start_index: 62
end_index: 64
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
42ExprTuple62, 55
43NamedExprsstate: 51
part: 53
44ExprTuple62, 63
45Literal
46NamedExprsstate: 52
part: 53
47Literal
48ExprTuple54, 55
49Literal
50Operationoperator: 56
operands: 57
51Literal
52Literal
53Variable
54Operationoperator: 59
operands: 58
55Operationoperator: 59
operands: 60
56Literal
57ExprTuple61, 63
58ExprTuple63, 62
59Literal
60ExprTuple63, 64
61Literal
62Literal
63Literal
64Literal