tensorcircuit.cloud.abstractionΒΆ
Abstraction for Provider, Device and Task
- class tensorcircuit.cloud.abstraction.Device(name: str, provider: str | Provider | None = None, lower: bool = False)[source]ΒΆ
Bases:
objectDevice abstraction for cloud connection, eg. quantum chips
- classmethod from_name(device: str | Device, provider: str | Provider | None = None) Device[source]ΒΆ
- list_properties() Dict[str, Any][source]ΒΆ
List all device properties in as dict
- Returns:
[description]
- Return type:
Dict[str, Any]
- native_gates() List[str][source]ΒΆ
List native gates supported for the device, str conforms qiskit convention
- Returns:
_description_
- Return type:
List[str]
- class tensorcircuit.cloud.abstraction.Provider(name: str, lower: bool = True)[source]ΒΆ
Bases:
objectProvider abstraction for cloud connection, eg. βtencentβ, βlocalβ
- exception tensorcircuit.cloud.abstraction.TCException[source]ΒΆ
Bases:
BaseException- __init__(*args, **kwargs)ΒΆ
- add_note()ΒΆ
Exception.add_note(note) β add a note to the exception
- argsΒΆ
- with_traceback()ΒΆ
Exception.with_traceback(tb) β set self.__traceback__ to tb and return self.
- class tensorcircuit.cloud.abstraction.Task(id_: str, device: Device | None = None)[source]ΒΆ
Bases:
objectTask abstraction for quantum jobs on the cloud
- details(blocked: bool = False, **kws: Any) Dict[str, Any][source]ΒΆ
Get the current task details
- Parameters:
blocked (bool) β whether return until task is finished, defaults to False
wait (bool) β alias for the argument
blocked
- Returns:
_description_
- Return type:
Dict[str, Any]
- get_device() Device[source]ΒΆ
Query which device the task is run on
- Returns:
_description_
- Return type:
- more_details: Dict[str, Any]ΒΆ
- results(format: str | None = None, blocked: bool = True, mitigated: bool = False, calibriation_options: Dict[str, Any] | None = None, readout_mit: ReadoutMit | None = None, mitigation_options: Dict[str, Any] | None = None) Dict[str, int][source]ΒΆ
get task results of the qjob
- Parameters:
format (Optional[str], optional) β unsupported now, defaults to None, which is βcount_dict_binβ
format β alias for the argument
formatblocked (bool, optional) β whether blocked to wait until the result is returned, defaults to False, which raise error when the task is unfinished
wait (bool, optional) β alias for the argument
blockedmitigated (bool, optional) β whether enable readout error mitigation, defaults to False
calibriation_options (Optional[Dict[str, Any]], optional) β option dict for
ReadoutMit.cals_from_system, defaults to Nonereadout_mit (Optional[rem.ReadoutMit], optional) β if given, directly use the calibriation info on
readout_mit, defaults to Nonemitigation_options (Optional[Dict[str, Any]], optional) β option dict for
ReadoutMit.apply_correction, defaults to None
- Returns:
count dict results
- Return type:
Any
- status() strΒΆ
Query the current task status
- Returns:
_description_
- Return type:
str
- exception tensorcircuit.cloud.abstraction.TaskException[source]ΒΆ
Bases:
TCException- __init__(*args, **kwargs)ΒΆ
- add_note()ΒΆ
Exception.add_note(note) β add a note to the exception
- argsΒΆ
- with_traceback()ΒΆ
Exception.with_traceback(tb) β set self.__traceback__ to tb and return self.
- exception tensorcircuit.cloud.abstraction.TaskFailed(taskid: str, state: str, message: str)[source]ΒΆ
Bases:
TaskException- add_note()ΒΆ
Exception.add_note(note) β add a note to the exception
- argsΒΆ
- with_traceback()ΒΆ
Exception.with_traceback(tb) β set self.__traceback__ to tb and return self.