mabuchilab / QNET

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

Allow CircuitSymbols labels to contain superscripts #78

Open goerz opened 6 years ago

goerz commented 6 years ago
>>> CircuitSymbol('BS^(0)', cdim=2)
Traceback (most recent call last):
  File "<ipython-input-4-e7d3c31fe419>", line 1, in <module>
    CircuitSymbol('BS^(0)', cdim=2)
  File "/home/goerz/Documents/Programming/QNET/src/qnet/algebra/core/circuit_algebra.py", line 603, in __init__
    % (self.label, self._rx_label.pattern))
ValueError: label 'BS^(0)' does not match pattern '^[A-Za-z][A-Za-z0-9]*(_[A-Za-z0-9().+-]+)?$'