# Initializing a state in a different basis

**URL:** <https://itensor.discourse.group/t/initializing-a-state-in-a-different-basis/2033>\
**Category:** ITensor Julia Questions\
**Created:** [October 1, 2024, 8:36pm UTC](https://itensor.discourse.group/t/initializing-a-state-in-a-different-basis/2033 "2024-10-01T20:36:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ray-l](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/ray-l/32/76_2.png) [@ray-l](https://itensor.discourse.group/u/ray-l)\
**Post date:** [October 1, 2024, 8:36pm UTC](https://itensor.discourse.group/t/initializing-a-state-in-a-different-basis/2033/1 "2024-10-01T20:36:28Z")

</div>

Suppose I need to initialize my system (with L sites and N particles) in some basis:  
 |init\rangle = \prod\_i^N c^{\dagger}\_i|vac\rangle

where |vac\rangle is simply

```julia
M = randomMPS(s, ["Emp" for _ in 1:N])
for i in 1:N
    Op = op("Cdag", s[i])
    M = apply(Op, M)
end 

```

This is I believe equivalent to

```julia
randomMPS(s, [n <= N ? "Occ" : "Emp" for n in 1:N])

```

Then is it possible to initialize this state in another basis, say:  
 a^{\dagger}\_j = \sum\_i U\_{ij} c^{\dagger}\_i

|init\rangle = \prod\_i^L c^{\dagger}\_i|vac\rangle = \prod\_i^L \sum\_j^N U\_{ij} a^{\dagger}\_j |vac\rangle

I convinced myself there’s no way to do this except summing up an exponentially many number of terms, is this correct?

---

<div class="post-metadata">

**Author:** ![ryanlevy](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/ryanlevy/32/150_2.png) [@ryanlevy](https://itensor.discourse.group/u/ryanlevy)\
**Post date:** [October 1, 2024, 9:02pm UTC](https://itensor.discourse.group/t/initializing-a-state-in-a-different-basis/2033/2 "2024-10-01T21:02:02Z")

</div>

I believe you’ll want to check out this package: [GitHub - ITensor/ITensorGaussianMPS.jl](https://github.com/ITensor/ITensorGaussianMPS.jl)  
The U in your example should be the same as \Phi in the main page example
