pasqal-io / qadence

Digital-analog quantum programming interface
https://pasqal-io.github.io/qadence/latest/
Apache License 2.0
69 stars 22 forks source link

[Feature, DA] Compile certain digital rotations directly in the emulated analog interface #192

Open jpmoutinho opened 10 months ago

jpmoutinho commented 10 months ago

Current emulated analog interface works with specific AnalogBlocks which are converted to HamEvo in the PyQ backend with the background interaction, or respective pulses in the Pulser backend. This can probably be done in a more general way by directly compiling blocks composed of digital rotations like kron(RX(i, angle) for i in range(n_qubits)). The advantages would be:

nmheim commented 10 months ago

While I'd like to get rid of the global qubit support as well, my understanding is that with our digital-analog approach we want to combine analog and digital gates, because they represent two fundamentally different modes of operation (essentially interaction on/off), so that a layer of RX rotations is something different than an AnalogRX block with the same qubit support. so we would still need some way of letting the user specify what kind of interaction they want. (Happy to be corrected though!:)

jpmoutinho commented 10 months ago

Thanks @nmheim! Sorry we discussed this a while ago and then I had a follow-up discussion with @madagra and then I never discussed it again with you. Indeed I think you are right about the modes of operation. What we are going for here would be a more general way to do it. Essentially the user would define whether their device operates according to either:

In principle, this change would be able to represent the current Analog blocks, but also extend a bit the capabilities in terms of other usecases:

nmheim commented 10 months ago

Ok, that sounds nice! And like a lot of cool work on transpilation. maybe we can drop python 3.9 support and use https://benhoyt.com/writings/python-pattern-matching/ @madagra ?

nvm, python can't pattern match as nice as I thought.

Roland-djee commented 7 months ago

@jpmoutinho Is this getting picked up ?

jpmoutinho commented 7 months ago

Not immediately, but yes I have this on my radar. I do think it will need to be done, but still unsure how.

Roland-djee commented 7 months ago

Not immediately, but yes I have this on my radar. I do think it will need to be done, but still unsure how.

OK I think we can pick that one up once we get seriously started on the compilation initiative.

Roland-djee commented 4 months ago

@kaosmicadei