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 matrix_left_polar_decomposition
In [2]:
# check that the built expression is the same as the stored expression
assert matrix_left_polar_decomposition.expr == stored_expr
assert matrix_left_polar_decomposition.expr._style_id == stored_expr._style_id
print("Passed sanity check: matrix_left_polar_decomposition matches stored_expr")
Passed sanity check: matrix_left_polar_decomposition matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{n \in \mathbb{N}^+}~\left[\forall_{A \in \mathbb{C}^{n \times n}}~\left[\exists_{U \in \textrm{U}\left(n\right)}~\left(A = \left(U \thinspace \sqrt{\left(A^{\dagger} \thinspace A\right)}\right)\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: 6
operand: 2
1ExprTuple2
2Lambdaparameter: 37
body: 3
3Conditionalvalue: 4
condition: 5
4Operationoperator: 6
operand: 9
5Operationoperator: 28
operands: 8
6Literal
7ExprTuple9
8ExprTuple37, 10
9Lambdaparameter: 51
body: 11
10Literal
11Conditionalvalue: 12
condition: 13
12Operationoperator: 14
operand: 17
13Operationoperator: 28
operands: 16
14Literal
15ExprTuple17
16ExprTuple51, 18
17Lambdaparameter: 35
body: 20
18Operationoperator: 21
operands: 22
19ExprTuple35
20Conditionalvalue: 23
condition: 24
21Literal
22NamedExprsfield: 25
rows: 37
columns: 37
23Operationoperator: 26
operands: 27
24Operationoperator: 28
operands: 29
25Literal
26Literal
27ExprTuple51, 30
28Literal
29ExprTuple35, 31
30Operationoperator: 42
operands: 32
31Operationoperator: 33
operand: 37
32ExprTuple35, 36
33Literal
34ExprTuple37
35Variable
36Operationoperator: 38
operands: 39
37Variable
38Literal
39ExprTuple40, 41
40Operationoperator: 42
operands: 43
41Operationoperator: 44
operands: 45
42Literal
43ExprTuple46, 51
44Literal
45ExprTuple47, 48
46Operationoperator: 49
operand: 51
47Literal
48Literal
49Literal
50ExprTuple51
51Variable