We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The printers currently cannot handle sums whose index goes over a range with a step other than 1:
>>> from qnet import * >>> i = IdxSym('i'); j = IdxSym('j') >>> ket_i = BasisKet(FockIndex(i), hs=0) >>> s = Sum(i, 1, 10, step=2)(ket_i) >>> srepr(s) "KetIndexedSum(BasisKet(FockIndex(IdxSym('i', integer=True)), hs=LocalSpace('0')), IndexOverRange(IdxSym('i', integer=True), 1, 10, step=2))" >>> ascii(s) Traceback (most recent call last): File "<ipython-input-8-f3c3ef6dce87>", line 1, in <module> ascii(s) File "/Users/goerz/Documents/Programming/github/QNET/src/qnet/printing/__init__.py", line 319, in ascii return ascii.printer.doprint(expr) File "/Users/goerz/Documents/Programming/github/QNET/src/qnet/printing/base.py", line 196, in doprint res = self._str(self._print(expr, *args, **kwargs)) File "/Users/goerz/Documents/Programming/github/QNET/.venv/py36/lib/python3.6/site-packages/sympy/printing/printer.py", line 257, in _print return getattr(self, printmethod)(expr, *args, **kwargs) File "/Users/goerz/Documents/Programming/github/QNET/src/qnet/printing/asciiprinter.py", line 486, in _print_IndexedSum current_index = self.doprint(index_range, which='bottom_index') File "/Users/goerz/Documents/Programming/github/QNET/src/qnet/printing/base.py", line 196, in doprint res = self._str(self._print(expr, *args, **kwargs)) File "/Users/goerz/Documents/Programming/github/QNET/.venv/py36/lib/python3.6/site-packages/sympy/printing/printer.py", line 257, in _print return getattr(self, printmethod)(expr, *args, **kwargs) File "/Users/goerz/Documents/Programming/github/QNET/src/qnet/printing/asciiprinter.py", line 565, in _print_IndexOverRange bottom_rhs += ", %s" % expr.start_from + expr.step TypeError: must be str, not int
One this is fixed, the doctest of Sum can be updated to test this case.
Sum
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The printers currently cannot handle sums whose index goes over a range with a step other than 1:
One this is fixed, the doctest of
Sum
can be updated to test this case.The text was updated successfully, but these errors were encountered: