How to run `tfq.layers` on simulators?
Shuhul24 opened this issue · 5 comments
I have got circuits that I have built using tfq.layers.ControlledPQC
. But now I want to use simulators such as cirq.Simulator()
to run the train these tfq.layers
on quantum hardware and check the results. How is it done?
Do you want to run on a simulator or hardware? Your question says you want to use simulators to train on hardware (which doesn't make sense). I assume you want to run on hardware (since you can pretty much just directly replace cirq.Simulator as a backend), which would depend on what hardware you want to use. Here is an example for IonQ hardware: https://ionq.com/docs/get-started-with-tensorflow-quantum.
How does replacing backend=cirq.Simulator()
change the training of tfq.layers.ControlledPQC
? I mean like I need to train on pure and mixed states, but could not get the way to do it. Can you figure this out?
How does replacing backend=cirq.Simulator() change the training of tfq.layers.ControlledPQC? It makes it run on cirq instead of qsim. It also runs a lot slower, but there is more customization you can do in cirq. If you want to do noisy simulations you can just use a noisy qsim backend via NoisyControlledPQC
. See for more info on noise: https://www.tensorflow.org/quantum/tutorials/noise
How can I run my code on qsim
? Is it inherent?
Yes, qsim is just the default