0 votes
asked by (310 points)

I am trying to find the ground state for a 2D Heisenberg hamiltonian. I want to use different initial states. I read the answers/ discussions regarding the same.

How can I build the random state on X basis? ( maybe using Hadamard as mentioned in other discussions) for the Julia version?

commented by (14.1k points)
You can use the `randomMPS` to build a random MPS (https://itensor.github.io/ITensors.jl/stable/MPSandMPO.html#ITensors.randomMPS-Tuple{Array{#s77,1}%20where%20#s77%3C:Index,Any} ). You can see how it is used here: https://github.com/ITensor/ITensors.jl/blob/master/examples/dmrg/1d_heisenberg_conserve_spin.jl#L27

If you don't specify a desired bond dimension, it simply creates a product state with randomized elements. If you specify a desired bond dimensions, it uses a random unitary circuit applied to the specified starting state.

I'm not quite sure what you mean by a random state in the X basis, if you are looking for something more specific let us know.
commented by (14.1k points)
Oh, I guess you might mean that you were interested in performing projective measurements in the X basis to obtain random bit strings. To do that, you can apply Hadamard gates and then use the `sample!` function. You can see examples of applying gates here: https://github.com/ITensor/ITensors.jl/blob/master/examples/gate_evolution/quantum_simulator.jl and the `sample!` function here: https://itensor.github.io/ITensors.jl/stable/MPSandMPO.html#ITensors.sample!-Tuple{MPS}

Please log in or register to answer this question.

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.