Inner Product¶
Symbolic inner product.
- class sympy.physics.quantum.innerproduct.InnerProduct(bra, ket)[source]¶
An unevaluated inner product between a Bra and a Ket [1].
- Parameters:
bra : BraBase or subclass
The bra on the left side of the inner product.
ket : KetBase or subclass
The ket on the right side of the inner product.
Examples
Create an InnerProduct and check its properties:
>>> from sympy.physics.quantum import Bra, Ket >>> b = Bra('b') >>> k = Ket('k') >>> ip = b*k >>> ip <b|k> >>> ip.bra <b| >>> ip.ket |k>
In quantum expressions, inner products will be automatically identified and created:
>>> b*k <b|k>
In more complex expressions, where there is ambiguity in whether inner or outer products should be created, inner products have high priority:
>>> k*b*k*b <b|k>*|k><b|
Notice how the inner product <b|k> moved to the left of the expression because inner products are commutative complex numbers.
References