Challenge: "Revisiting Schrodinger's cat"

Hi! I’ve been working on the Coding Challenges and I have doubts about the results in Revisiting Schrodinger’s cat.

I’ll try to ask my question without revealing too much of the code and keep the challenge interesting.

As I understand it, the challenge asks for an optimization of the parameters of the U3 gate, such that: if the state |0\rangle is read on the “atom” qubit, then the “cat” qubit is known to be in |+\rangle.

Initially, I made my algorithm such that it optimized the U3 parameters to minimize err:

diff = evolve\_atom\_cat(unitary, params) - [ \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}, 0 ,0]

err = \overline{|diff|}

I tried multiple optimization methods but didn’t get them to converge.

  1. Is it possible to optimize the parameters of the U3 such that it creates the state [ \frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}, 0 ,0]?

Instead, I figured I could optimize them such that the probability of p(|00\rangle) == p(|01\rangle), which means there’s a superposition on the ‘cat’ qubit. This passes the tests… However, I’m not convinced this is the right answer.

  1. Does p(|00\rangle) == p(|01\rangle) guarantee that reading ‘atom’ as |0\rangle, we have 50% probability of sampling ‘cat’ in 0 or 1, i.e. it’s in the |+⟩ state?

Hello @jpinilla! Welcome to the forum!

It seems approach 2. may have worked due to a fluke! There could be a phase difference between the amplitudes, which wouldn’t give you the correct state. The correct approach is 1. It is possible to make it converge!

Cheers,

Alvaro

1 Like

Thanks @Alvaro_Ballon ! I accidentally bumped into that “solution”, so maybe it’s worth changing the check() method?

1 Like

Agreed! Thanks @jpinilla !