google / qhbm-library

Quantum Hamiltonian-Based Models built on TensorFlow Quantum
https://qhbm-library.readthedocs.io/en/latest/
Apache License 2.0
40 stars 15 forks source link

Enable tracing of QuantumCircuit __add__ #131

Closed zaqqwerty closed 2 years ago

zaqqwerty commented 2 years ago

Patch and test tracing add for QuantumCircuits.

Resolves #128. Inside tfq.from_tensor, .numpy() is called (ref #129), so tracing did not work. This PR changes the signature of QuantumCircuit initialization to avoid calling tfq.from_tensor during addition.