logo
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_theorem_expr # Load the stored theorem expression as 'stored_expr'
# import the special expression
from proveit.physics.quantum.QPE import _non_int_delta_b_diff
In [2]:
# check that the built expression is the same as the stored expression
assert _non_int_delta_b_diff.expr == stored_expr
assert _non_int_delta_b_diff.expr._style_id == stored_expr._style_id
print("Passed sanity check: _non_int_delta_b_diff matches stored_expr")
Passed sanity check: _non_int_delta_b_diff matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{b \in \left\{b_{\textit{f}}, b_{\textit{r}}\right\}, l \in \{-2^{t - 1} + 1~\ldotp \ldotp~2^{t - 1}\}~|~l \neq 0}~\left(\left(\delta_{b} - \frac{l}{2^{t}}\right) \notin \mathbb{Z}\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: 1
operand: 3
1Literal
2ExprTuple3
3Lambdaparameters: 4
body: 5
4ExprTuple35, 43
5Conditionalvalue: 6
condition: 7
6Operationoperator: 8
operands: 9
7Operationoperator: 10
operands: 11
8Literal
9ExprTuple12, 13
10Literal
11ExprTuple14, 15, 16
12Operationoperator: 53
operands: 17
13Literal
14Operationoperator: 19
operands: 18
15Operationoperator: 19
operands: 20
16Operationoperator: 21
operands: 22
17ExprTuple23, 24
18ExprTuple35, 25
19Literal
20ExprTuple43, 26
21Literal
22ExprTuple43, 27
23Operationoperator: 28
operand: 35
24Operationoperator: 57
operand: 36
25Operationoperator: 31
operands: 32
26Operationoperator: 33
operands: 34
27Literal
28Literal
29ExprTuple35
30ExprTuple36
31Literal
32ExprTuple37, 38
33Literal
34ExprTuple39, 48
35Variable
36Operationoperator: 40
operands: 41
37Literal
38Literal
39Operationoperator: 53
operands: 42
40Literal
41ExprTuple43, 44
42ExprTuple45, 59
43Variable
44Operationoperator: 49
operands: 46
45Operationoperator: 57
operand: 48
46ExprTuple51, 55
47ExprTuple48
48Operationoperator: 49
operands: 50
49Literal
50ExprTuple51, 52
51Literal
52Operationoperator: 53
operands: 54
53Literal
54ExprTuple55, 56
55Literal
56Operationoperator: 57
operand: 59
57Literal
58ExprTuple59
59Literal