Closed gamatos closed 2 years ago
I totally agree that we should be consistent with the TketModel
here. Needs to be changed!
The original reason why we did not square the absolute value of the amplitudes was that they used this as a metric in the "QNLP in practice" paper (if I'm not mistaken).
As discussed internally, this has meaning only for the NumpyModel (not the TketModel). There will be a fix included in the next release.
The issue will be now closed.
Hi,
I've noticed that the normalisation of the quantum state done in the following lines of the
QuantumModel._normalise_vector
functionhttps://github.com/CQCL/lambeq/blob/f6fa5a70d241e3eeff81d8125ce1629bbe94e3be/lambeq/training/quantum_model.py#L70-L71
seems to be missing a square along with the absolute value, i.e. it should be something like
so that the resulting probabilities match those one would get from measuring the quantum state in the specified basis.