qutip / qutip-qip

The QuTiP quantum information processing package
https://qutip-qip.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
116 stars 63 forks source link

Pulse class: consider changing description or code refactoring #98

Closed nathanshammah closed 2 years ago

nathanshammah commented 3 years ago

It has been brought up that the Pulse class can be confusing for the user, as it brings together control pulses, the relative Hamiltonian, and noise added to the control pulses. This issue is opened to discuss this point and see what action to take.

There is also some conceptual overlap between qutip-qip.Pulse and qutip.QobjEvo (and qutip.Qobj for the time-constant part).

Right now the Pulse class is also discussed in https://qutip-qip.readthedocs.io/en/latest/qip-processor.html#modelling-quantum-hardware-with-processor.

The actions to be taken can be discussed here, for example:

BoxiLi commented 3 years ago

My preferred solution would be:

The biggest problem I see is that the list of Pulse is partially initialized at the initialization of a Processor (including only the Hamiltonians, no coeff), which is indeed a less-optimal design. So I suggest to add a Model class that contains only Hamiltonian information. The class takes the hardware parameters to initialize

class Model():
    def __init__(params):
        ...

model = SpinChainModel({"h":0.01, ...})

and has a `call' that returns the corresponding Hamiltonian. The Hamiltonian Qobj can be obtained by

model("sx0")

or whatever identifier that matches the implementation of the class, i.e.

model("sx", 0)

Advantages are:

@nathanshammah @quantshah Any opinions?

BoxiLi commented 3 years ago

I also mentioned in https://github.com/qutip/qutip-qip/discussions/101 a possible upgrade for the Hamiltonian coefficients.