Hello everyone,
I would like to compute the fidelity between two squeezed coherent states using the Strawberry Fields bosonic backend, but I am not sure about the correct method.
As far as I understand, a squeezed coherent state can be written as
|\\alpha, r, \\phi\\rangle = D(\\alpha),S(r,\\phi),|0\\rangle
where:
-
(D(\alpha)) is the displacement operator (coherent amplitude),
-
(S(r,\phi)) is the squeezing operator,
-
(|0\rangle) is the vacuum state.
I know that the function state.fidelity_coherent() computes the fidelity between a state and a coherent state, but it does not work when the target state is also a squeezed coherent state.
So my questions are:
-
What is the correct way to compute the fidelity between two squeezed coherent states in the bosonic backend?
-
Is it recommended to use the covariance matrix and means to compute the Gaussian-state fidelity manually?
-
Is there a built-in function that supports fidelity between general Gaussian states, including squeezed coherent states?
Any guidance or examples would be greatly appreciated.
Thank you.
Hi @Orleans_Cardoso , welcome to the Forum!
StrawberryFields has been under maintenance mode for several years and it has now been fully deprecated so we no longer provide official support for it.
That being said, the fidelity.coherent() method probably doesn’t work because Strawberry Fields considers squeezed states to be different from coherent states.
If you use the Fock backend or the Gaussian backend you could use the fidelity() method. For the Gaussian backend for example you could use a Sequence (mu, cov) containing the means and covariance matrix for the other state.
I hope this helps!
Hello,
Thank you for the clarification.
Unfortunately, using the Fock backend is not feasible for my simulations. The circuit involves six modes with relatively large coherent amplitudes (α ≈ 4), squeezing (r ≈ 1.5), and squeezed cat states, which require a very large cutoff dimension to achieve reliable convergence. In practice, the Hilbert space dimension grows exponentially with the number of modes, making the full Fock simulation prohibitively expensive in both memory and runtime.
For this reason, I am using the bosonic backend, which allows me to simulate non-Gaussian states such as squeezed cat states more efficiently. In my workflow I obtain the quantum states directly in ket form, so in principle I can access the full state vector representation.
My goal is to compute the fidelity between squeezed coherent states and conditional output states. The function fidelity.coherent() does not apply in this case because the target states include squeezing, not only displacement.
Since I already have access to the ket representation of the states, I would like to know whether there is a recommended or reliable way to compute the fidelity directly from the ket vectors in Strawberry Fields, or possibly using The Walrus or PennyLane tools.
In particular, I am interested in computing:
F = |⟨ψ_target | ψ_output⟩|²
where both states may include displacement and squeezing.
Any guidance would be greatly appreciated.
Thanks for the additional details @Orleans_Cardoso .
Given that there’s no Strawberry Fields function to calculate fidelity for what you need, then I’d recommend for you to look at the literature and look at the math to see how others have calculated this in the past.
If you wanted to use PennyLane you’d need to go back to v0.29 of PennyLane which is quite old now, so it may not work at all in your current environment.
You can also look into The Walrus to see if there’s something for this. If you do find something please let me know here!