Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplying kets should produce a tensor product #19538

Open
m93a opened this issue Jun 11, 2020 · 0 comments
Open

Multiplying kets should produce a tensor product #19538

m93a opened this issue Jun 11, 2020 · 0 comments

Comments

@m93a
Copy link
Contributor

m93a commented Jun 11, 2020

Input code

srepr(qapply(Ket('a') * Ket('b')))

Expected output

TensorProduct(Ket(Symbol('a')), Ket(Symbol('b')))

Actual output

Mul(Ket(Symbol('a')), Ket(Symbol('b')))

Rationale

Qapply converts bra × ket to inner product and ket × bra to outer product. This gives a precedent to also support the rules bra × bra → tensor product of bras, ket × ket → tensor product of kets.

srepr(qapply(Bra('a')*Ket('b')))
> InnerProduct(Bra(Symbol('a')),Ket(Symbol('b')))

srepr(qapply(Ket('a')*Bra('b')))
> OuterProduct(Ket(Symbol('a')),Bra(Symbol('b')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants