logo

Common expressions for the theory of proveit.physics.quantum.algebra

In [1]:
import proveit
# Prepare this notebook for defining the common expressions of a theory:
%common_expressions_notebook # Keep this at the top following 'import proveit'.

from proveit import Variable, Literal
from proveit import n, v
from proveit.numbers import zero, one, two, subtract, Interval, Exp
from proveit.physics.quantum import Bra, Ket
from proveit.physics.quantum.algebra.hilbert_spaces import (
    HilbertSpacesLiteral)
from proveit.physics.quantum.algebra.qmult import (
    QmultCodomainLiteral)
In [2]:
%begin common
Defining common sub-expressions for theory 'proveit.physics.quantum.algebra'
Subsequent end-of-cell assignments will define common sub-expressions
%end_common will finalize the definitions
In [3]:
HilbertSpaces = HilbertSpacesLiteral()
Out[3]:
HilbertSpaces:

Use $\mathcal{H}$ as a generic Hilbert space:

In [4]:
Hspace = Variable('H', r'\mathcal{H}')
Out[4]:
Hspace:

QmultCodomain is the proper class containing all possible Qmult evaluations if and only if the sequence of operands (bras, kets, and/or quantum operators) is valid:

In [5]:
QmultCodomain = QmultCodomainLiteral()
Out[5]:
QmultCodomain:
In [6]:
n_bit_interval = Interval(zero, subtract(Exp(two, n), one))
Out[6]:
n_bit_interval:
In [7]:
%end common
These common expressions may now be imported from the theory package: proveit.physics.quantum.algebra