+1 vote
asked by (610 points)
edited by


I would like to remove the quantum numbers of ITensors (or MPS) in Julia, so that I can do contractions between MPS with QNs and operators which do NOT have the corresponding quantum symmetry.

I find a similar problem has been solved,


But that function (i.e., removeqns(psi)) with the same name in Julia can only be applied to indices, not ITensors nor MPS.


1 Answer

0 votes
answered by (70.1k points)

Hi Junsen,
This is a good question. For the Julia version of ITensor, we are soon planning to implement removeqns for the ITensor level but haven't just yet.

But if what you want for now is to map block sparse ITensors to dense ITensors, you can call the function dense on an ITensor and it will do the behavior that you are wanting.

The plan for removeqns is that it will keep other sparsity (such as diagonal sparsity) while removing QN information. This is in contrast to the dense functiono which removes all sparsity, whether associated with QNs or not.

So in short, please try dense on your ITensors. I'm implementing a version of that you can call directly on an MPS too right now, but with the current version you'll need to call it on each tensor yourself.


commented by (70.1k points)
Here's our plan for how `dense` versus `removeqns` will behave in the Julia version of ITensor:
commented by (610 points)
Thank you, Miles. This `dense` function is indeed a workaround for my case!

I am also looking forward to that more advanced 'removeqns' function in the Julia version.
Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.