qiskit-community / qiskit-dynamics

Tools for building and solving models of quantum systems in Qiskit
https://qiskit-community.github.io/qiskit-dynamics/
Apache License 2.0
106 stars 60 forks source link

Add DynamicsBackend channel methods #183

Closed DanPuzzuoli closed 1 year ago

DanPuzzuoli commented 1 year ago

Summary

Closes #144

Adds drive_channel, measure_channel, acquire_channel, and control_channel methods to DynamicsBackend, and includes tests for these methods.

Details

The drive_channel, measure_channel, and acquire_channel methods first check if the requested qubit index is in options.subsystem_list, and if so, returns pulse.ChannelClass(qubit) (where ChannelClass is either DriveChannel, MeasureChannel, or AcquireChannel).

As there isn't an automatic relationship between control channels and any existing backend parameters, to implement control_channel, a further option, control_channel_map, has been added. This is a user-specified dictionary indication a mapping between control channel labels and control channel indices. E.g. a control channel map specified as {(0, 1): 0} could be used to indicate that the control channel associated with a CR drive from qubit 0 with target 1 is pulse.ControlChannel(0). If this option is specified, then control_channel uses the dictionary to return the correct ControlChannel instance. The default for the option is None. When None, the control_channel will raise a NotImplementedError, which is the default behaviour from the base class.

Tests have been added to verify validation steps are working, and that the methods return the correct channels.