could not display_lattice of a standard lattice1d

36 views
Skip to first unread message

Chris Nill

unread,
Oct 17, 2021, 11:07:31 AM10/17/21
to QuTiP: Quantum Toolbox in Python
Hi,

I'm Chris and new to QuTiP.

Consider the notebook below with QuTiP 4.6 installed.


I would like to create a chain of 2-level atoms with lattice1d().

In the notebook they start with
Periodic_Atom_Chain = Lattice1d(num_cell=3, boundary = 'periodic')

If we consider the docs, the other parameters get default initialized with
  • cell_num_site=1
  • cell_site_dof=[1]
  • Hamiltonian_of_cell=None
  • inter_hop=None
Then I want to print the lattice with the method display_lattice()

But an error occurs: IndexError: list index out of range

The only thing I could figure out was to change
cell_site_dof=[2,2] or even higher...
So the range error vanishes.

But this couldn't be the real solution...
Any Idea where the problem is located?

Thanks in advance!





Simon Cross

unread,
Oct 25, 2021, 11:59:19 AM10/25/21
to qu...@googlegroups.com
Hi Chris,

Thank you for reporting this rather embarrassing bug. Unfortunately the qutip.lattice module needs some work. I've dug into the code a bit and created a minimal fix in https://github.com/qutip/qutip/pull/1697.

If you can confirm that it works for you and that the code change makes sense, I'm happy to merge it as "better than what is there now".

Ideally we need someone who is actively using qutip.lattice to help maintain it though. If you would like to volunteer, I'm happy to help provide guidance and review pull requests. If you're keen, let me know, otherwise keep reporting bugs and we'll see what we can do.

Yours sincerely,
Simon Cross

Saumya biswas

unread,
Oct 26, 2021, 1:23:17 AM10/26/21
to qu...@googlegroups.com
Hi. Chris.
Sorry, we did not get any questions for qutip.lattice in a while.
Could you please check out the two pull requests I created

I hope all the examples work now. Please let me know if you need any help.

Saumya




--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/CAD5NRCFfw0Y9arJ5btCw1BmUoQWQ%2B%2BQ7gbhNWcU-Wrj3AhCNbQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages