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.linear_algebra.inner_products import schmidt_decomposition
In [2]:
# check that the built expression is the same as the stored expression
assert schmidt_decomposition.expr == stored_expr
assert schmidt_decomposition.expr._style_id == stored_expr._style_id
print("Passed sanity check: schmidt_decomposition matches stored_expr")
Passed sanity check: schmidt_decomposition matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{m, n \in \mathbb{N}^+}~\left[\begin{array}{l}\forall_{A, B \underset{{\scriptscriptstyle c}}{\in} \textrm{HilbertSpaces}~|~\textrm{Dim}\left(A\right) = m, \textrm{Dim}\left(B\right) = n}~\\
\left[\forall_{v \in A {\otimes} B}~\left[\begin{array}{l}\exists_{a_{1}, a_{2}, \ldots, a_{m}~|~\left\{a_{1}, a_{2}, \ldots, a_{m}\right\} \in \textrm{O.N.Bases}\left(A\right)}~\\
\left[\begin{array}{l}\exists_{b_{1}, b_{2}, \ldots, b_{n}~|~\left\{b_{1}, b_{2}, \ldots, b_{n}\right\} \in \textrm{O.N.Bases}\left(B\right)}~\\
\left[\begin{array}{l}\exists_{\lambda_{1}, \lambda_{2}, \ldots, \lambda_{{\rm Min}\left(m, n\right)} \in \mathbb{R}^{\ge 0}}~\\
\left(v = \left(\sum_{i=1}^{{\rm Min}\left(m, n\right)} \left(\lambda_{i} \cdot \left(a_{i} {\otimes} b_{i}\right)\right)\right)\right)\end{array}\right]\end{array}\right]\end{array}\right]\right]\end{array}\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: 17
operand: 2
1ExprTuple2
2Lambdaparameters: 120
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 17
operand: 8
5Operationoperator: 80
operands: 7
6ExprTuple8
7ExprTuple9, 10
8Lambdaparameters: 43
body: 11
9Operationoperator: 100
operands: 12
10Operationoperator: 100
operands: 13
11Conditionalvalue: 14
condition: 15
12ExprTuple122, 16
13ExprTuple123, 16
14Operationoperator: 17
operand: 20
15Operationoperator: 80
operands: 19
16Literal
17Literal
18ExprTuple20
19ExprTuple21, 22, 23, 24
20Lambdaparameter: 83
body: 26
21Operationoperator: 28
operands: 27
22Operationoperator: 28
operands: 29
23Operationoperator: 78
operands: 30
24Operationoperator: 78
operands: 31
25ExprTuple83
26Conditionalvalue: 32
condition: 33
27ExprTuple57, 34
28Literal
29ExprTuple76, 34
30ExprTuple35, 122
31ExprTuple36, 123
32Operationoperator: 58
operand: 40
33Operationoperator: 100
operands: 38
34Literal
35Operationoperator: 39
operand: 57
36Operationoperator: 39
operand: 76
37ExprTuple40
38ExprTuple83, 41
39Literal
40Lambdaparameters: 52
body: 42
41Operationoperator: 108
operands: 43
42Conditionalvalue: 44
condition: 45
43ExprTuple57, 76
44Operationoperator: 58
operand: 48
45Operationoperator: 100
operands: 47
46ExprTuple48
47ExprTuple49, 50
48Lambdaparameters: 69
body: 51
49Operationoperator: 68
operands: 52
50Operationoperator: 70
operand: 57
51Conditionalvalue: 54
condition: 55
52ExprTuple56
53ExprTuple57
54Operationoperator: 58
operand: 62
55Operationoperator: 100
operands: 60
56ExprRangelambda_map: 61
start_index: 114
end_index: 122
57Variable
58Literal
59ExprTuple62
60ExprTuple63, 64
61Lambdaparameter: 106
body: 65
62Lambdaparameters: 66
body: 67
63Operationoperator: 68
operands: 69
64Operationoperator: 70
operand: 76
65IndexedVarvariable: 116
index: 106
66ExprTuple72
67Conditionalvalue: 73
condition: 74
68Literal
69ExprTuple75
70Literal
71ExprTuple76
72ExprRangelambda_map: 77
start_index: 114
end_index: 115
73Operationoperator: 78
operands: 79
74Operationoperator: 80
operands: 81
75ExprRangelambda_map: 82
start_index: 114
end_index: 123
76Variable
77Lambdaparameter: 106
body: 96
78Literal
79ExprTuple83, 84
80Literal
81ExprTuple85
82Lambdaparameter: 106
body: 86
83Variable
84Operationoperator: 87
operand: 90
85ExprRangelambda_map: 89
start_index: 114
end_index: 115
86IndexedVarvariable: 117
index: 106
87Literal
88ExprTuple90
89Lambdaparameter: 106
body: 91
90Lambdaparameter: 121
body: 92
91Operationoperator: 100
operands: 93
92Conditionalvalue: 94
condition: 95
93ExprTuple96, 97
94Operationoperator: 98
operands: 99
95Operationoperator: 100
operands: 101
96IndexedVarvariable: 107
index: 106
97Literal
98Literal
99ExprTuple103, 104
100Literal
101ExprTuple121, 105
102ExprTuple106
103IndexedVarvariable: 107
index: 121
104Operationoperator: 108
operands: 109
105Operationoperator: 110
operands: 111
106Variable
107Variable
108Literal
109ExprTuple112, 113
110Literal
111ExprTuple114, 115
112IndexedVarvariable: 116
index: 121
113IndexedVarvariable: 117
index: 121
114Literal
115Operationoperator: 119
operands: 120
116Variable
117Variable
118ExprTuple121
119Literal
120ExprTuple122, 123
121Variable
122Variable
123Variable