QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.
https://yaoquantum.org
Other
918 stars 119 forks source link

automatic diffirentaion through circuit with conditional gate #418

Open rezah opened 2 years ago

rezah commented 2 years ago

It is possible to do automatic differentiation through a circuit with conditional gates. I mean variationally optimize the circuit with gates that are applied based on themed-circuit measurement.

GiggleLiu commented 2 years ago

It is hard to do it directly. Try using lower level interfaces like apply and mat. Their backward rules are ported to ChainRules. Maybe you can try writing the loss using Zygote.

GiggleLiu commented 2 years ago

Please check this issues: #323