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_op_op_in_QmultCodomain
In [2]:
# check that the built expression is the same as the stored expression
assert qmult_op_op_in_QmultCodomain.expr == stored_expr
assert qmult_op_op_in_QmultCodomain.expr._style_id == stored_expr._style_id
print("Passed sanity check: qmult_op_op_in_QmultCodomain matches stored_expr")
Passed sanity check: qmult_op_op_in_QmultCodomain matches stored_expr
In [3]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\forall_{\mathcal{H}, X, Y \underset{{\scriptscriptstyle c}}{\in} \textrm{HilbertSpaces}}~\left[\forall_{A, B~|~\left[A\right] \in \mathcal{L}\left(X, Y\right), \left[B\right] \in \mathcal{L}\left(\mathcal{H}, X\right)}~\left(\left(A \thinspace B\right) \underset{{\scriptscriptstyle c}}{\in} \mathcal{Q^*}\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: 7
operand: 2
1ExprTuple2
2Lambdaparameters: 3
body: 4
3ExprTuple46, 47, 44
4Conditionalvalue: 5
condition: 6
5Operationoperator: 7
operand: 10
6Operationoperator: 23
operands: 9
7Literal
8ExprTuple10
9ExprTuple11, 12, 13
10Lambdaparameters: 29
body: 14
11Operationoperator: 21
operands: 15
12Operationoperator: 21
operands: 16
13Operationoperator: 21
operands: 17
14Conditionalvalue: 18
condition: 19
15ExprTuple46, 20
16ExprTuple47, 20
17ExprTuple44, 20
18Operationoperator: 21
operands: 22
19Operationoperator: 23
operands: 24
20Literal
21Literal
22ExprTuple25, 26
23Literal
24ExprTuple27, 28
25Operationoperator: 39
operands: 29
26Literal
27Operationoperator: 31
operands: 30
28Operationoperator: 31
operands: 32
29ExprTuple43, 45
30ExprTuple33, 34
31Literal
32ExprTuple35, 36
33Operationoperator: 39
operand: 43
34Operationoperator: 41
operands: 38
35Operationoperator: 39
operand: 45
36Operationoperator: 41
operands: 42
37ExprTuple43
38ExprTuple47, 44
39Literal
40ExprTuple45
41Literal
42ExprTuple46, 47
43Variable
44Variable
45Variable
46Variable
47Variable