Adjoint differentiation for pennylane-cirq

Hey pennylane community,

so to scale our training code we have been using pennylane-cirq with the cuQuantum appliance to scale to multiple GPUs.

Unfortunately the adjoint differentiation method is not supported for cirq.
Is there any chance of bringing it to the cirq plugin?
In principle where would this have to be implemented ?
I checked the code for the adjoint differentiation in the lightning.gpu plugin, since I would like to use it with cuQuantum, I assume it will be hard to add directly via the pennylane-cirq plugin, and would rather have to be added on the cirq/qsim side ?

Any thoughts would be appreciated, considering the huge speedup from adjoint differentiation it would be very good to get it working with these simulators.


Hi @ToMago !

I believe that in principle it should be implemented in the pennylane-cirq plugin. @Tom_Bromley, do you have any suggestions here?

Hi @ToMago!

I’m less familiar with the GPU capabilities in cirq - is multi-GPU support through cuquantum part of the qsim simulator? And the reason you would like to use the pennylane-cirq plugin rather than lightning.gpu is the need for multi-GPU execution?

If so, it might be worth checking out lightning.gpu since it does have some level of multi-GPU support: if you are returning expectation values of multiple observables or the expectation value of a Hamiltonian, then lightning.gpu will distribute the observables over multiple GPUs. Would this fit what you would like to do?

Hey @CatalinaAlbornoz and @Tom_Bromley, thanks for your help!

I am using pennylane-cirq since it has the best multi gpu support together with the cuQuantum appliance, e.g. it supports the splitting of the state vector, which is especially interesting for larger qbit numbers.

Lightning.gpu currently does not support this type of scaling.

I just thought since the code is there for lightning.gpu maybe there is a comparatively easy way to port it to pennylane-cirq


Thanks @ToMago! This is good feedback.

We are open to adding adjoint-method support to the Cirq devices, though I don’t think we’ll be able to do this soon enough for your current needs.