GTorlai / PastaQ.jl

Package for Simulation, Tomography and Analysis of Quantum Computers
Apache License 2.0
142 stars 23 forks source link

Custom unentangled density matrix for initial state #297

Open GibbsJR opened 2 years ago

GibbsJR commented 2 years ago

I have an unentangled density matrix that I would like to use as my starting initial state, with which I can encode as a MPO. My state has the same form as (S44) in https://arxiv.org/pdf/2002.08953.pdf. This type of state feels like it should be easy to represent as an MPO due to the tensor product form, but I am unsure where to start.

GibbsJR commented 2 years ago

Looking at the presentation in https://github.com/mtfishman/ITensorTutorials.jl it seems I would be able to to construct the local MPO on each qubit directly from the matrix representation (with independent indices for each site), then I can compose these tensors together to generate the total MPO.

Assuming I can create this MPO correctly using ITensors, can this MPO be fed directly into 'runcircuit' as the starting state, which I can apply gates to?

mtfishman commented 2 years ago

Yes, that is what I was going to suggest. You can just make an MPO from a set of ITensors:

n = 10
s = siteinds("Qubit", n)
rho = MPO(n)
for j in 1:n
  m_j = zeros(2, 2) # Make the matrix however you want
  rho[j] = itensor(m_j, s[j], s[j]')
end