This is really a nice work. The library works out smoothly.
One tiny bug I spotted when playing with the example is In the state preparation code, instead of
loss = 1 - tf.tensordot(psi_out[:, 0], psi_true, axes=1)
one should use,
overlap = tf.tensordot(tf.math.conj(psi_out[:, 0]), psi_true, axes=1)
loss = 1 - tf.math.real(overlap)
## or consider
## 1 - tf.math.real(overlap * tf.math.conj(overlap))
## This is the error in fidelity
At least the conjugate is needed, otherwise, the state obtain would be the conjugation of the target state.
This is really a nice work. The library works out smoothly.
One tiny bug I spotted when playing with the example is In the state preparation code, instead of
one should use,
At least the conjugate is needed, otherwise, the state obtain would be the conjugation of the target state.