Node classes
The Node interface
---
config:
look: handDrawn
theme: neutral
---
flowchart TD
A["baseNode.calibration()"] --> B["baseNode.measure()"]
B --> C["baseNode.post_process()"]
The basic Node structure consists of a calibration() method, a measure() method and a post_process() method.
- the calibration() method is implemented at the baseNode and returns a calibrationStatus
- the measure() method is NOT implemented at the baseNode. To allow more flexibility in how measurements are performed, the measurement type is injected for each particular node. The following section presents the details.
- the post_process() method is implemented at the baseNode.
Node Categories
Each node can act either on Qubits or Couplers. In each case node attributes and methods may have different requirements so
each node implementation has to inherint either from the
QubitNode or the CouplerNode defining class.
The execution of many nodes consists of a single schedule compilation, a single measurement and a single
post-processing.
However, for more adavanced nodes where more complex measurements are needed, this workflow can become limiting.
To allow greater flexibility a class attribute in the node implementation defines the measurement type as
ScheduleNode, OuterScheduleNode, ExternalParameterNode. Even more measurement classes can be introduced. The only requirement is that in measurement type class must implement a measure() method that returns an xarray.Dataset
ScheduleNode: The simple way of doing the measurement and having an analysis afterward. This node compiles one time- The quantities in the
node.schedule_samplespaceare swept in the schedule. They uploaded to the cluster all at once.
- The quantities in the
ExternalParameterNode: A looping over a parameter that is external to the schedule. The measurement will be split in multiple batches, equal to the number of the samples in thenode.external_samplespace.- Both
node.schedule_samplespaceandnode.external_samplespaceshould be provided. As an example, thecoupler_spectroscopynode sweeps thedc_currentoutside of the schedule:
- Both
OuterScheduleNode: A looping over a parameter that although is part of the schedule, is loop outside of it. The measurement will be split again in multiple runs, equal to the number of the samples in thenode.outer_schedule_samplespace. This type of measurement existsts only to overcome limitations in the intstructions and acquisitions memory of the Qblox Cluster.
Below, there is an example for an ExternalParameterNode implementation.
Please read the guide about how to create a new node to learn more about nodes.
This guide also contains an example for a ScheduleNode.
Examples of nodes requiring an external samplespace
coupler_spectroscopysweeps thedc_currentwhich is set by the SPI rack not the clusterT1sweeps a repetition index to repeat the measurement many times
Examples of nodes requiring an outer schedule samplespace
- randomized_benchmarking sweeps different seeds. Although the seed is a schedule parameter, sweeping outside the
schedule improves memory utilization.