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 R11_to_Rkm, S11_to_Skm, T11_to_Tlm
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(R11_to_Rkm, S11_to_Skm, T11_to_Tlm)
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(R_{1, 1}, R_{1, 2}, \ldots, R_{1, m}, R_{2, 1}, R_{2, 2}, \ldots, R_{2, m}, \ldots\ldots, R_{k, 1}, R_{k, 2}, \ldots, R_{k, m},S_{1, 1}, S_{1, 2}, \ldots, S_{1, m}, S_{2, 1}, S_{2, 2}, \ldots, S_{2, m}, \ldots\ldots, S_{k, 1}, S_{k, 2}, \ldots, S_{k, m},T_{1, 1}, T_{1, 2}, \ldots, T_{1, m}, T_{2, 1}, T_{2, 2}, \ldots, T_{2, m}, \ldots\ldots, T_{l, 1}, T_{l, 2}, \ldots, T_{l, m}\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, 3
1ExprRangelambda_map: 4
start_index: 16
end_index: 6
2ExprRangelambda_map: 5
start_index: 16
end_index: 6
3ExprRangelambda_map: 7
start_index: 16
end_index: 8
4Lambdaparameter: 26
body: 9
5Lambdaparameter: 26
body: 10
6Variable
7Lambdaparameter: 26
body: 12
8Variable
9ExprRangelambda_map: 13
start_index: 16
end_index: 17
10ExprRangelambda_map: 14
start_index: 16
end_index: 17
11ExprTuple26
12ExprRangelambda_map: 15
start_index: 16
end_index: 17
13Lambdaparameter: 27
body: 18
14Lambdaparameter: 27
body: 19
15Lambdaparameter: 27
body: 21
16Literal
17Variable
18IndexedVarvariable: 22
indices: 25
19IndexedVarvariable: 23
indices: 25
20ExprTuple27
21IndexedVarvariable: 24
indices: 25
22Variable
23Variable
24Variable
25ExprTuple26, 27
26Variable
27Variable