qiskit.providers.basicaer.UnitarySimulatorPy¶
-
class
UnitarySimulatorPy
(configuration=None, provider=None, **fields)[source]¶ Python implementation of a unitary simulator.
Initialize a backend class
- Paramètres
configuration (BackendConfiguration) – A backend configuration object for the backend object.
provider (qiskit.providers.Provider) – Optionally, the provider object that this Backend comes from.
fields – kwargs for the values to use to override the default options.
- Lève
AttributeError – if input field not a valid options
-
__init__
(configuration=None, provider=None, **fields)[source]¶ Initialize a backend class
- Paramètres
configuration (BackendConfiguration) – A backend configuration object for the backend object.
provider (qiskit.providers.Provider) – Optionally, the provider object that this Backend comes from.
fields – kwargs for the values to use to override the default options.
- Lève
AttributeError – if input field not a valid options
Methods
__init__
([configuration, provider])Initialize a backend class
Return the backend configuration.
name
()Return the backend name.
Return the backend properties.
provider
()Return the backend Provider.
run
(qobj, **backend_options)Run qobj asynchronously.
run_experiment
(experiment)Run an experiment (circuit) and return a single experiment result.
set_options
(**fields)Set the options fields for the backend
status
()Return the backend status.
Attributes
DEFAULT_CONFIGURATION
DEFAULT_OPTIONS
MAX_QUBITS_MEMORY
Return the options for the backend
version
-
configuration
()¶ Return the backend configuration.
- Renvoie
the configuration for the backend.
- Type renvoyé
-
name
()¶ Return the backend name.
- Renvoie
the name of the backend.
- Type renvoyé
str
-
property
options
¶ Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()
method.
-
properties
()¶ Return the backend properties.
- Renvoie
the configuration for the backend. If the backend does not support properties, it returns
None
.- Type renvoyé
-
provider
()¶ Return the backend Provider.
- Renvoie
the Provider responsible for the backend.
- Type renvoyé
-
run
(qobj, **backend_options)[source]¶ Run qobj asynchronously.
- Paramètres
qobj (Qobj) – payload of the experiment
backend_options (dict) – backend options
- Renvoie
derived from BaseJob
- Type renvoyé
Additional Information:
backend_options: Is a dict of options for the backend. It may contain * "initial_unitary": matrix_like * "chop_threshold": double The "initial_unitary" option specifies a custom initial unitary matrix for the simulator to be used instead of the identity matrix. This size of this matrix must be correct for the number of qubits inall experiments in the qobj. The "chop_threshold" option specifies a truncation value for setting small values to zero in the output unitary. The default value is 1e-15. Example:: backend_options = { "initial_unitary": np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]]) "chop_threshold": 1e-15 }
-
run_experiment
(experiment)[source]¶ Run an experiment (circuit) and return a single experiment result.
- Paramètres
experiment (QobjExperiment) – experiment from qobj experiments list
- Renvoie
A result dictionary which looks something like:
{ "name": name of this experiment (obtained from qobj.experiment header) "seed": random seed used for simulation "shots": number of shots used in the simulation "data": { "unitary": [[[0.0, 0.0], [1.0, 0.0]], [[1.0, 0.0], [0.0, 0.0]]] }, "status": status string for the simulation "success": boolean "time taken": simulation time of this single experiment }
- Type renvoyé
dict
- Lève
BasicAerError – if the number of qubits in the circuit is greater than 24.
Note that the practical qubit limit is much lower than 24. –
-
set_options
(**fields)¶ Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Paramètres
fields – The fields to update the options
- Lève
AttributeError – If the field passed in is not part of the options
-
status
()¶ Return the backend status.
- Renvoie
the status of the backend.
- Type renvoyé