QuEraComputing / bloqade-python

QuEra's Neutral Atom SDK for Analog QPUs
https://bloqade.quera.com/
Other
55 stars 14 forks source link

IR 2.0: ideas collection #668

Open Roger-luo opened 1 year ago

Roger-luo commented 1 year ago

opening this to track some ideas and issues we have for a refactor of the IR.

weinbe58 commented 1 year ago

I think we should probably extend IR to include execution instructions to the different backends:

weinbe58 commented 1 year ago

I propose the following. Since we don't really plan on expanding AHS too much more, we should:

  1. remove dictionaries from the IR types and replace them with attributes, e.g. rydberg, and hyperfine are attributes of the Sequence
  2. Remove compositions on the level of the Pulse IR, this will significantly decrease the complexity of code generation for the full IR. e.g. have a Pulse node to store detuning phase and amplitude.
  3. ComplexField for the Rabi term.

class SequenceExpr
    ...

class ComplexField:
    amplitude: Field
    phase: Optional[Field]

class Pulse:
    detuning: Optional[Field]
    rabi: Optional[ComplexField]

class Sequence(SeqenceExpr):
    rydberg: Optional[Pulse]
    hyperfine: Optional[Pulse]

# keep compositions of Sequence
# ...