class PulseQobjConfigSchema(QobjConfigSchema): """Schema for PulseQobjConfig.""" # Required properties. # TODO : check if they are always required by backend meas_level = Integer(required=True, validate=Range(min=0, max=2)) memory_slot_size = Integer(required=True) pulse_library = Nested(QobjPulseLibrarySchema, many=True, required=True) qubit_lo_freq = List(Number(), required=True) meas_lo_freq = List(Number(), required=True) rep_time = Integer(required=True) meas_return = String(validate=OneOf(choices=(MeasReturnType.AVERAGE, MeasReturnType.SINGLE)))
class JobsStatusFilterQueryParamRequestSchema(BaseSchema): """Nested schema for JobsStatusRequestSchema""" # Optional properties where = Dict(attribute="extra_filter", required=False, description="additional filtering passed to the query.") # Required properties order = String(required=True, default="creationDate DESC") limit = Number(required=True, description="maximum number of items to return.") skip = Number(required=True, description="offset for the items to return.")
class PulseDefaultsSchema(BaseSchema): """Schema for PulseDefaults.""" # Required properties. qubit_freq_est = List(Number(), required=True, validate=Length(min=1)) meas_freq_est = List(Number(), required=True, validate=Length(min=1)) buffer = Integer(required=True, validate=Range(min=0)) pulse_library = Nested(PulseLibraryItemSchema, required=True, many=True) cmd_def = Nested(CommandSchema, many=True, required=True) # Optional properties. meas_kernel = Nested(MeasurementKernelSchema) discriminator = Nested(DiscriminatorSchema)
class PulseQobjConfigSchema(QobjConfigSchema): """Schema for PulseQobjConfig of device backend.""" # Required properties. meas_level = Integer(required=True, validate=Range(min=0, max=2)) meas_return = String(required=True, validate=OneOf(choices=(MeasReturnType.AVERAGE, MeasReturnType.SINGLE))) pulse_library = Nested(PulseLibraryItemSchema, required=True, many=True) qubit_lo_freq = List(Number(validate=Range(min=0)), required=True) meas_lo_freq = List(Number(validate=Range(min=0)), required=True) # Optional properties. memory_slot_size = Integer(validate=Range(min=1)) rep_time = Integer(validate=Range(min=0))
class NduvSchema(BaseSchema): """Schema for name-date-unit-value.""" # Required properties. date = DateTime(required=True) name = String(required=True) unit = String(required=True) value = Number(required=True)
class JobsRequestSchema(BaseSchema): """Schema for JobsRequest""" # Optional properties name = String(required=False, description="custom name to be assigned to the job.") # Required properties qObject = Dict(required=True, description="the Qobj to be executed, as a dictionary.") backend = Nested(BackendRequestSchema, required=True) shots = Number(required=True)
class PulseQobjInstructionSchema(QobjInstructionSchema): """Schema for PulseQobjInstruction.""" # pylint: disable=invalid-name # Required properties t0 = Integer(required=True, validate=Range(min=0)) # Optional properties. ch = String(validate=Regexp('[dum]([0-9])+')) conditional = Integer(validate=Range(min=0)) phase = Number() val = Complex() duration = Integer(validate=Range(min=1)) qubits = List(Integer(validate=Range(min=0)), validate=Length(min=1)) memory_slot = List(Integer(validate=Range(min=0)), validate=Length(min=1)) register_slot = List(Integer(validate=Range(min=0)), validate=Length(min=1)) kernels = Nested(QobjMeasurementOptionSchema, many=True) discriminators = Nested(QobjMeasurementOptionSchema, many=True) label = String() type = String()
class PulseQobjExperimentConfigSchema(QobjExperimentConfigSchema): """Schema for PulseQobjExperimentConfig.""" # Optional properties. qubit_lo_freq = List(Number()) meas_lo_freq = List(Number())