Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[New Device Capabilities] Implement the
DeviceCapabilities
data cla…
…ss and the TOML module. (#6407) This implementation assumes the new TOML schema as defined below: ```toml schema = 3 # The set of all gate types supported at the runtime execution interface of the # device, i.e., what is supported by the `execute` method of the Device API. # The gate definition has the following format: # # GATE = { properties = [ PROPS ], conditions = [ CONDS ] } # # where PROPS and CONS are zero or more comma separated quoted strings. # # PROPS: zero or more comma-separated quoted strings: # - "controllable": if a controlled version of this gate is supported. # - "invertible": if the adjoint of this operation is supported. # - "differentiable": if device gradient is supported for this gate. # CONDS: zero or more comma-separated quoted strings: # - "analytic" or "finiteshots": if this operation is only supported in # either analytic execution or with shots, respectively. # - "terms-commute": if this composite operator is only supported # given that its terms commute. Only relevant for Prod, SProd, Sum, # LinearCombination, and Hamiltonian. # [operators.gates] PauliX = { properties = ["controllable", "invertible"] } PauliY = { properties = ["controllable", "invertible"] } PauliZ = { properties = ["controllable", "invertible"] } RY = { properties = ["controllable", "invertible", "differentiable"] } RZ = { properties = ["controllable", "invertible", "differentiable"] } CRY = { properties = ["invertible", "differentiable"] } CRZ = { properties = ["invertible", "differentiable"] } CNOT = { properties = ["invertible"] } # Observables that the device is able to measure. [operators.observables] PauliX = { } PauliY = { } PauliZ = { } Hamiltonian = { } Sum = { } SProd = { } Prod = { } # Types of measurement processes supported on the device. [measurement_processes] ExpectationMP = { } SampleMP = { } CountsMP = { conditions = ["finiteshots"] } StateMP = { conditions = ["analytic"] } # Additional support that the device may provide. All accepted fields and their # default values are listed below. Any fields missing from the TOML file will be # set to their default values. [compilation] # Whether the device is compatible with qjit. qjit_compatible = false # Whether the device requires run time generation of the quantum circuit. runtime_code_generation = false # Whether the device supports dynamic qubit allocation/deallocation. dynamic_qubit_management = false # Whether simultaneous measurements of observables with overlapping wires is supported. overlapping_observables = true # Whether simultaneous measurements of non-commuting observables is supported. non_commuting_observables = false # Whether the device supports initial state preparation. initial_state_prep = false # The methods of handling mid-circuit measurements that the device supports, e.g., # "one-shot", "device", "tree-traversal", etc. An empty list indicates that the device # does not support mid-circuit measurements. supported_mcm_methods = [ ] # These options represent custom runtime parameters that can be passed to the # device upon initialization. A dictionary will be constructed at run time # containing the entries below. [options] option_key = "option_field" ``` [sc-71712]
- Loading branch information