mabuchilab / QNET

Computer algebra package for quantum mechanics and photonic quantum networks
https://qnet.readthedocs.io/
MIT License
71 stars 23 forks source link

LocalSigma does not check if basis is valid #62

Closed goerz closed 6 years ago

goerz commented 6 years ago

The following should fail, as '0' and '1' are not labels that are in the basis:

>>> from qnet.algebra import *
>>> hs = LocalSpace('tls', basis=('g', 'e'))
>>> LocalSigma('0', '1', hs=hs)
|0⟩⟨1|⁽ᵗˡˢ⁾