Index direction

Hi,

I’m new in using Julia version of the Itensors, but I’m not able to recover the result from the documentation

using ITensors
Index([QN("Sz", -1) => 1, QN("Sz", 1) => 1], "i"; dir = In)

gives me an error: In is not defined; Instead, I’m using dir = ITensors.Arrow(1) or dir = ITensors.Arrow(-1);
I’m I doing something wrong, or it is a bug?

Best,
Murod

Hi Murod,
Thanks for the question. You can write

Index([QN("Sz", -1) => 1, QN("Sz", 1) => 1], "i"; dir = ITensors.In)

to get the In variable from the ITensors module. Alternatively you can put:

import ITensors: In

at the top of your code if it doesn’t cause any problems.

The reason it’s not imported by default is that other packages also define the variable In, so it can cause problems sometimes if we imported it by default also.

1 Like

I see, thank you, Miles.
Best regards,
Murod

1 Like