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.algebra import qmult_pulling_scalars_out_front
In [2]:
# check that the built expression is the same as the stored expression
assert qmult_pulling_scalars_out_front.expr == stored_expr
assert qmult_pulling_scalars_out_front.expr._style_id == stored_expr._style_id
print("Passed sanity check: qmult_pulling_scalars_out_front matches stored_expr")
Passed sanity check: qmult_pulling_scalars_out_front matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{j, l, n \in \mathbb{N}}~\left[\forall_{b_{1}, b_{2}, \ldots, b_{j} \in \mathbb{C}}~\left[\forall_{A_{1}, A_{2}, \ldots, A_{l}, C_{1}, C_{2}, \ldots, C_{n}~|~\left(A_{1} \thinspace  A_{2} \thinspace  \ldots \thinspace  A_{l}\thinspace C_{1} \thinspace  C_{2} \thinspace  \ldots \thinspace  C_{n}\right) \underset{{\scriptscriptstyle c}}{\in} \mathcal{Q^*}}~\left(\begin{array}{c} \begin{array}{l} \left(A_{1} \thinspace  A_{2} \thinspace  \ldots \thinspace  A_{l}\thinspace b_{1} \thinspace  b_{2} \thinspace  \ldots \thinspace  b_{j}\thinspace C_{1} \thinspace  C_{2} \thinspace  \ldots \thinspace  C_{n}\right) =  \\ \left(b_{1} \thinspace  b_{2} \thinspace  \ldots \thinspace  b_{j}\thinspace A_{1} \thinspace  A_{2} \thinspace  \ldots \thinspace  A_{l}\thinspace C_{1} \thinspace  C_{2} \thinspace  \ldots \thinspace  C_{n}\right) \end{array} \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: 21
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple51, 53, 56
4Conditionalvalue: 5
condition: 6
5Operationoperator: 21
operand: 9
6Operationoperator: 23
operands: 8
7ExprTuple9
8ExprTuple10, 11, 12
9Lambdaparameters: 13
body: 14
10Operationoperator: 36
operands: 15
11Operationoperator: 36
operands: 16
12Operationoperator: 36
operands: 17
13ExprTuple47
14Conditionalvalue: 18
condition: 19
15ExprTuple51, 20
16ExprTuple53, 20
17ExprTuple56, 20
18Operationoperator: 21
operand: 25
19Operationoperator: 23
operands: 24
20Literal
21Literal
22ExprTuple25
23Literal
24ExprTuple26
25Lambdaparameters: 46
body: 27
26ExprRangelambda_map: 28
start_index: 55
end_index: 51
27Conditionalvalue: 29
condition: 30
28Lambdaparameter: 64
body: 31
29Operationoperator: 32
operands: 33
30Operationoperator: 34
operands: 35
31Operationoperator: 36
operands: 37
32Literal
33ExprTuple38, 39
34Literal
35ExprTuple40, 41
36Literal
37ExprTuple57, 42
38Operationoperator: 45
operands: 43
39Operationoperator: 45
operands: 44
40Operationoperator: 45
operands: 46
41Literal
42Literal
43ExprTuple48, 47, 49
44ExprTuple47, 48, 49
45Literal
46ExprTuple48, 49
47ExprRangelambda_map: 50
start_index: 55
end_index: 51
48ExprRangelambda_map: 52
start_index: 55
end_index: 53
49ExprRangelambda_map: 54
start_index: 55
end_index: 56
50Lambdaparameter: 64
body: 57
51Variable
52Lambdaparameter: 64
body: 58
53Variable
54Lambdaparameter: 64
body: 59
55Literal
56Variable
57IndexedVarvariable: 60
index: 64
58IndexedVarvariable: 61
index: 64
59IndexedVarvariable: 62
index: 64
60Variable
61Variable
62Variable
63ExprTuple64
64Variable