QuantumClifford.jl icon indicating copy to clipboard operation
QuantumClifford.jl copied to clipboard

Computing complex inner products

Open QCmonk opened this issue 1 year ago • 7 comments

Hello,

As I understand it, computation of the absolute value of the inner product between two stabilizer states is already supported through the dot and logdot calls. Looking at the source code/issue history this was done using the method described in this paper. In that paper they also give a method (just after section 5.2) for computing the actual inner product between two stabiliser states i.e. the complex valued overlap. It would be fantastic if this functionality could be added as from what I can tell no other stabiliser focused package in Julia or Python support this functionality.

Best, QCmonk

QCmonk avatar Jun 29 '23 16:06 QCmonk

You are right, and that would be a great enhancement. I do not think that any of the current maintainers will be able to focus on this in the near term, but if you can contribute a PR with it, I will be sure to help with getting it polished and then merged.

Krastanov avatar Jun 29 '23 20:06 Krastanov

That is fair enough. I will see if I can get a working example going and update the issue when I have a PR ready.

QCmonk avatar Jun 30 '23 08:06 QCmonk

So having dug into this it seems the best option for my personal needs is to instead reproduce the work of Bravyi et. al. in Julia.

Rather than using this packages source code, this will involve creating yet another representation of stabiliser states but one that carries global phase information (critical for my aims). I'm happy to do this and share a PR once complete but I'm not sure if its purpose goes beyond the scope of what is intended here? The representation is fundamentally different (though easy to transform between it and the more familiar 2NxN+1 tableau.

If still interested I will finish writing a simple example version that can be inspected and considered for inclusion.

Best, QCmonk

QCmonk avatar Jul 21 '23 13:07 QCmonk

Yes, that is of interest. On skimming through the paper it seems they do need to pass through a state vector representation at some point. That seems rather expensive, but the library already has capabilities for that if needed:

julia> using QuantumClifford, QuantumOpticsBase

julia> Ket(S"XX ZZ")
Ket(dim=4)
  basis: [Spin(1/2) ⊗ Spin(1/2)]
 0.7071067811865474 + 0.0im
                0.0 + 0.0im
                0.0 + 0.0im
 0.7071067811865474 + 0.0im

Krastanov avatar Jul 21 '23 14:07 Krastanov

I am not sure where that is kicking in - the whole point of the paper is to try and simulate arbitrary quantum states without ever invoking the full vector/density operator description else the simulation point becomes moot.

That aside, it is certainly true that if one stays within the stabiliser formalism however then only the work within section 4 is required and this is polynomial in the number of qubits with several nice complexity guarantees for measurement and inner product computation. I suspect it is possible to use this method to compute (complex) inner products between stabilizer states in $O(N^2)$ time, though this would require extension to their work.

QCmonk avatar Jul 21 '23 15:07 QCmonk

Excuse the closing, a case of slow-brain. I have not forgotten about this, but I ended up extending the functionality quite a bit beyond the original manuscript. I will write a paper about some of the additional techniques I have developed for stabilizer states in the CH formalism but am still happy to integrate my Julia code here.

QCmonk avatar Sep 21 '23 10:09 QCmonk

Sounds great! Looking forward to reading this work.

Krastanov avatar Sep 21 '23 12:09 Krastanov