Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computing complex inner products #140

Open
QCmonk opened this issue Jun 29, 2023 · 7 comments
Open

Computing complex inner products #140

QCmonk opened this issue Jun 29, 2023 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@QCmonk
Copy link

QCmonk commented Jun 29, 2023

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

@Krastanov Krastanov added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 29, 2023
@Krastanov
Copy link
Member

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.

@QCmonk
Copy link
Author

QCmonk commented Jun 30, 2023

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
Copy link
Author

QCmonk commented Jul 21, 2023

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

@Krastanov
Copy link
Member

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

@QCmonk
Copy link
Author

QCmonk commented Jul 21, 2023

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 QCmonk closed this as completed Sep 21, 2023
@QCmonk QCmonk reopened this Sep 21, 2023
@QCmonk
Copy link
Author

QCmonk commented Sep 21, 2023

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.

@Krastanov
Copy link
Member

Sounds great! Looking forward to reading this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants