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, ExprRange
from proveit import i, n, m, v
from proveit.logic import Set
from proveit.core_expr_types import a_i, b_i, x_i, v_i, w_i
from proveit.numbers import zero, one, two, subtract, Interval, Exp
from proveit.physics.quantum import Bra, Ket
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


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 [3]:
QmultCodomain = QmultCodomainLiteral()

QmultCodomain:
In [4]:
n_bit_interval = Interval(zero, subtract(Exp(two, n), one))

n_bit_interval:
In [5]:
x_1_to_n_kets = Set(ExprRange(i, Ket(x_i), one, n))

x_1_to_n_kets:
In [6]:
a_1_to_m_kets = Set(ExprRange(i, Ket(a_i), one, m))

a_1_to_m_kets:
In [7]:
b_1_to_n_kets = Set(ExprRange(i, Ket(b_i), one, n))

b_1_to_n_kets:
In [8]:
v_1_to_m_kets = Set(ExprRange(i, Ket(v_i), one, m))

v_1_to_m_kets:
In [9]:
v_1_to_n_kets = Set(ExprRange(i, Ket(v_i), one, n))

v_1_to_n_kets:
In [10]:
w_1_to_n_kets = Set(ExprRange(i, Ket(w_i), one, n))

w_1_to_n_kets:
In [11]:
%end common

These common expressions may now be imported from the theory package: proveit.physics.quantum.algebra