logo

Expression of type ExprTuple

from the theory of proveit.physics.quantum.circuits

In [1]:
import proveit
# Automation is not needed when building an expression:
proveit.defaults.automation = False # This will speed things up.
proveit.defaults.inline_pngs = False # Makes files smaller.
%load_expr # Load the stored expression as 'stored_expr'
# import Expression classes needed to build the expression
from proveit import ExprTuple
from proveit.core_expr_types.expr_arrays import A11_to_Akl_varray, B11_to_Bkl_varray
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(A11_to_Akl_varray, B11_to_Bkl_varray)
expr:
In [3]:
# check that the built expression is the same as the stored expression
assert expr == stored_expr
assert expr._style_id == stored_expr._style_id
print("Passed sanity check: expr matches stored_expr")
Passed sanity check: expr matches stored_expr
In [4]:
# Show the LaTeX representation of the expression for convenience if you need it.
print(stored_expr.latex())
\left(\left(\begin{array}{cccc} 
 A_{1, 1} & A_{2, 1} & \cdots & A_{k, 1} \\
A_{1, 2} & A_{2, 2} & \cdots & A_{k, 2} \\
\vdots & \vdots & \ddots & \vdots \\
A_{1, l} & A_{2, l} & \cdots & A_{k, l} \\
\end{array}
\right), \left(\begin{array}{cccc} 
 B_{1, 1} & B_{2, 1} & \cdots & B_{k, 1} \\
B_{1, 2} & B_{2, 2} & \cdots & B_{k, 2} \\
\vdots & \vdots & \ddots & \vdots \\
B_{1, l} & B_{2, l} & \cdots & B_{k, l} \\
\end{array}
\right)\right)
In [5]:
stored_expr.style_options()
namedescriptiondefaultcurrent valuerelated methods
wrap_positionsposition(s) at which wrapping is to occur; 'n' is after the nth comma.()()('with_wrapping_at',)
justificationif any wrap positions are set, justify to the 'left', 'center', or 'right'leftleft('with_justification',)
In [6]:
# display the expression information
stored_expr.expr_info()
 core typesub-expressionsexpression
0ExprTuple1, 2
1ExprTuple3
2ExprTuple4
3ExprRangelambda_map: 5
start_index: 15
end_index: 7
4ExprRangelambda_map: 6
start_index: 15
end_index: 7
5Lambdaparameter: 23
body: 8
6Lambdaparameter: 23
body: 10
7Variable
8ExprTuple11
9ExprTuple23
10ExprTuple12
11ExprRangelambda_map: 13
start_index: 15
end_index: 16
12ExprRangelambda_map: 14
start_index: 15
end_index: 16
13Lambdaparameter: 24
body: 17
14Lambdaparameter: 24
body: 19
15Literal
16Variable
17IndexedVarvariable: 20
indices: 22
18ExprTuple24
19IndexedVarvariable: 21
indices: 22
20Variable
21Variable
22ExprTuple23, 24
23Variable
24Variable