logo

Axiom QPE1_def of type Forall

from the theory of proveit.physics.quantum.QPE

see dependencies

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_axiom_expr # Load the stored axiom expression as 'stored_expr'
# import the special expression
from proveit.physics.quantum.QPE import QPE1_def
In [2]:
# check that the built expression is the same as the stored expression
assert QPE1_def.expr == stored_expr
assert QPE1_def.expr._style_id == stored_expr._style_id
print("Passed sanity check: QPE1_def matches stored_expr")
Passed sanity check: QPE1_def matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{s, t \in \mathbb{N}^+}~\left[\forall_{U \in \textrm{U}\left(2^{s}\right)}~\left(\left(\begin{array}{c} \Qcircuit@C=1em @R=.7em{
& \multigate{1}{\textrm{QPE}_1\left(U, t\right)} & { /^{t} } \qw \\
& \ghost{\textrm{QPE}_1\left(U, t\right)} & { /^{s} } \qw
} \end{array}\right) \cong \left(\begin{array}{c} \Qcircuit@C=1em @R=.7em{
& \control{} \qw \qwx[1] & \qw & \gate{\cdots} \qwx[1] & \qw & \qw \\
& \qw \qwx[1] & \control{} \qw \qwx[1] & \gate{\cdots} \qwx[1] & \qw & \qw \\
& \gate{\vdots} \qwx[1] & \gate{\vdots} \qwx[1] & \gate{\ddots} \qwx[1] & \gate{\vdots} & \qw \\
& \qw \qwx[1] & \qw \qwx[1] & \gate{\cdots} \qwx[1] & \control{} \qw \qwx[1] & \qw \\
& \gate{U^{2^{t - 1}}} & \gate{U^{2^{t - 2}}} & \gate{\cdots} & \gate{U^{2^{0}}} & { /^{s} } \qw
} \end{array}\right)\right)\right]
In [4]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
with_wrappingIf 'True', wrap the Expression after the parametersNoneNone/False('with_wrapping',)
condition_wrappingWrap 'before' or 'after' the condition (or None).NoneNone/False('with_wrap_after_condition', 'with_wrap_before_condition')
wrap_paramsIf 'True', wraps every two parameters AND wraps the Expression after the parametersNoneNone/False('with_params',)
justificationjustify to the 'left', 'center', or 'right' in the array cellscentercenter('with_justification',)
In [5]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0Operationoperator: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple99, 107
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 11
6Operationoperator: 9
operands: 10
7Literal
8ExprTuple11
9Literal
10ExprTuple12, 13
11Lambdaparameter: 97
body: 15
12Operationoperator: 23
operands: 16
13Operationoperator: 23
operands: 17
14ExprTuple97
15Conditionalvalue: 18
condition: 19
16ExprTuple99, 20
17ExprTuple107, 20
18Operationoperator: 21
operands: 22
19Operationoperator: 23
operands: 24
20Literal
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple97, 27
25Operationoperator: 29
operand: 33
26Operationoperator: 29
operands: 30
27Operationoperator: 31
operand: 35
28ExprTuple33
29Literal
30ExprTuple34
31Literal
32ExprTuple35
33ExprTuple36, 37
34ExprRangelambda_map: 38
start_index: 39
end_index: 40
35Operationoperator: 101
operands: 41
36ExprRangelambda_map: 42
start_index: 108
end_index: 107
37ExprRangelambda_map: 42
start_index: 100
end_index: 85
38Lambdaparameter: 111
body: 43
39Operationoperator: 103
operands: 44
40Literal
41ExprTuple105, 99
42Lambdaparameter: 90
body: 45
43ExprTuple46, 47
44ExprTuple48, 108
45Operationoperator: 77
operands: 49
46ExprRangelambda_map: 50
start_index: 108
end_index: 107
47ExprRangelambda_map: 51
start_index: 108
end_index: 99
48Operationoperator: 109
operand: 107
49NamedExprselement: 53
targets: 54
50Lambdaparameter: 90
body: 55
51Lambdaparameter: 90
body: 57
52ExprTuple107
53Operationoperator: 80
operands: 58
54Operationoperator: 75
operands: 59
55Operationoperator: 60
operands: 61
56ExprTuple90
57Operationoperator: 77
operands: 62
58NamedExprsoperation: 63
part: 90
59ExprTuple108, 85
60Literal
61ExprTuple64, 65
62NamedExprselement: 66
targets: 67
63Operationoperator: 68
operands: 69
64Conditionalvalue: 70
condition: 71
65Conditionalvalue: 72
condition: 73
66Operationoperator: 80
operands: 74
67Operationoperator: 75
operands: 76
68Literal
69ExprTuple97, 107
70Operationoperator: 77
operands: 78
71Operationoperator: 79
operands: 83
72Operationoperator: 80
operands: 81
73Operationoperator: 82
operands: 83
74NamedExprsoperation: 84
part: 90
75Literal
76ExprTuple100, 85
77Literal
78NamedExprselement: 86
targets: 87
79Literal
80Literal
81NamedExprsoperation: 88
82Literal
83ExprTuple89, 90
84Operationoperator: 91
operands: 92
85Operationoperator: 103
operands: 93
86Literal
87Operationoperator: 94
operand: 100
88Literal
89Operationoperator: 103
operands: 96
90Variable
91Literal
92ExprTuple97, 98
93ExprTuple107, 99
94Literal
95ExprTuple100
96ExprTuple111, 107
97Variable
98Operationoperator: 101
operands: 102
99Variable
100Operationoperator: 103
operands: 104
101Literal
102ExprTuple105, 106
103Literal
104ExprTuple107, 108
105Literal
106Operationoperator: 109
operand: 111
107Variable
108Literal
109Literal
110ExprTuple111
111Variable