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_scalar_out_front
In [2]:
# check that the built expression is the same as the stored expression
assert qmult_pulling_scalar_out_front.expr == stored_expr
assert qmult_pulling_scalar_out_front.expr._style_id == stored_expr._style_id
print("Passed sanity check: qmult_pulling_scalar_out_front matches stored_expr")
Passed sanity check: qmult_pulling_scalar_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_{l, n \in \mathbb{N}}~\left[\forall_{b \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\thinspace C_{1} \thinspace  C_{2} \thinspace  \ldots \thinspace  C_{n}\right) =  \\ \left(b\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: 20
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple45, 48
4Conditionalvalue: 5
condition: 6
5Operationoperator: 20
operand: 10
6Operationoperator: 8
operands: 9
7ExprTuple10
8Literal
9ExprTuple11, 12
10Lambdaparameter: 41
body: 14
11Operationoperator: 22
operands: 15
12Operationoperator: 22
operands: 16
13ExprTuple41
14Conditionalvalue: 17
condition: 18
15ExprTuple45, 19
16ExprTuple48, 19
17Operationoperator: 20
operand: 24
18Operationoperator: 22
operands: 23
19Literal
20Literal
21ExprTuple24
22Literal
23ExprTuple41, 25
24Lambdaparameters: 40
body: 26
25Literal
26Conditionalvalue: 27
condition: 28
27Operationoperator: 29
operands: 30
28Operationoperator: 31
operands: 32
29Literal
30ExprTuple33, 34
31Literal
32ExprTuple35, 36
33Operationoperator: 39
operands: 37
34Operationoperator: 39
operands: 38
35Operationoperator: 39
operands: 40
36Literal
37ExprTuple42, 41, 43
38ExprTuple41, 42, 43
39Literal
40ExprTuple42, 43
41Variable
42ExprRangelambda_map: 44
start_index: 47
end_index: 45
43ExprRangelambda_map: 46
start_index: 47
end_index: 48
44Lambdaparameter: 54
body: 49
45Variable
46Lambdaparameter: 54
body: 50
47Literal
48Variable
49IndexedVarvariable: 51
index: 54
50IndexedVarvariable: 52
index: 54
51Variable
52Variable
53ExprTuple54
54Variable