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)
%begin common
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:
QmultCodomain = QmultCodomainLiteral()
n_bit_interval = Interval(zero, subtract(Exp(two, n), one))
x_1_to_n_kets = Set(ExprRange(i, Ket(x_i), one, n))
a_1_to_m_kets = Set(ExprRange(i, Ket(a_i), one, m))
b_1_to_n_kets = Set(ExprRange(i, Ket(b_i), one, n))
v_1_to_m_kets = Set(ExprRange(i, Ket(v_i), one, m))
v_1_to_n_kets = Set(ExprRange(i, Ket(v_i), one, n))
w_1_to_n_kets = Set(ExprRange(i, Ket(w_i), one, n))
%end common