Closed ecsbeats closed 2 years ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
For more information, open the CLA check for this pull request.
I casted the sigma
argument for the fidelity function to the dtype complex128
in the test_fidelity_random
function inside /tests/inference/qhbm_utils_tests.py::FidelityTest
This way if there is any errors or difference between the output of the faster fidelity function
and the direct matrix to matrix fidelity function it will be detected.
I also updated the docstring
of the fidelity function to reflect the generalization of the dtype of the sigma
argument.
Thanks for the update, I like the direction here. One last thing in the test: it should check that fidelity
accepts both tf.complex64
and tf.complex128
- currently, it only checks that fidelity
accepts tf.complex128
.
So I would recommend making a copy of your code from lines 106 through 111: in one block, fidelity_wrapper
gets sent a tf.complex64
; in the other, fidelity_wrapper
gets sent a tf.complex128
.
I duplicated lines 106-111
and in the second portion used the sigma of dtype
complex64
in the actual fidelity function, though avoided recalcuating
the direct fidelity function in the second portion to keep the test fast.
Casts
sigma
argument of thefideltity
function to thetf.complex64
dtype. Resolves #195