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_Akm, B11_to_Bkn, R11_to_Rkm, S11_to_Skn
In [2]:
# build up the expression from sub-expressions
expr = ExprTuple(A11_to_Akm, R11_to_Rkm, B11_to_Bkn, S11_to_Skn)
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(A_{1, 1}, A_{1, 2}, \ldots, A_{1, m}, A_{2, 1}, A_{2, 2}, \ldots, A_{2, m}, \ldots\ldots, A_{k, 1}, A_{k, 2}, \ldots, A_{k, m},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},B_{1, 1}, B_{1, 2}, \ldots, B_{1, n}, B_{2, 1}, B_{2, 2}, \ldots, B_{2, n}, \ldots\ldots, B_{k, 1}, B_{k, 2}, \ldots, B_{k, n},S_{1, 1}, S_{1, 2}, \ldots, S_{1, n}, S_{2, 1}, S_{2, 2}, \ldots, S_{2, n}, \ldots\ldots, S_{k, 1}, S_{k, 2}, \ldots, S_{k, n}\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, 4
1ExprRangelambda_map: 5
start_index: 20
end_index: 9
2ExprRangelambda_map: 6
start_index: 20
end_index: 9
3ExprRangelambda_map: 7
start_index: 20
end_index: 9
4ExprRangelambda_map: 8
start_index: 20
end_index: 9
5Lambdaparameter: 32
body: 10
6Lambdaparameter: 32
body: 11
7Lambdaparameter: 32
body: 12
8Lambdaparameter: 32
body: 14
9Variable
10ExprRangelambda_map: 15
start_index: 20
end_index: 17
11ExprRangelambda_map: 16
start_index: 20
end_index: 17
12ExprRangelambda_map: 18
start_index: 20
end_index: 21
13ExprTuple32
14ExprRangelambda_map: 19
start_index: 20
end_index: 21
15Lambdaparameter: 33
body: 22
16Lambdaparameter: 33
body: 23
17Variable
18Lambdaparameter: 33
body: 24
19Lambdaparameter: 33
body: 26
20Literal
21Variable
22IndexedVarvariable: 27
indices: 31
23IndexedVarvariable: 28
indices: 31
24IndexedVarvariable: 29
indices: 31
25ExprTuple33
26IndexedVarvariable: 30
indices: 31
27Variable
28Variable
29Variable
30Variable
31ExprTuple32, 33
32Variable
33Variable