StatevectorSimulatorPy#
- class qiskit.providers.basicaer.StatevectorSimulatorPy(configuration=None, provider=None, **fields)[source]#
Bases:
QasmSimulatorPy
Python statevector simulator.
Initialize a backend class
- প্যারামিটার:
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.
- রেইজেস:
AttributeError -- if input field not a valid options
In addition to the public abstract methods, subclasses should also implement the following private methods:
- classmethod _default_options()
Return the default options
This method will return a
qiskit.providers.Options
subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.- রিটার্নস:
- A options object with
default values set
- রিটার্ন টাইপ:
Attributes
- DEFAULT_CONFIGURATION = {'backend_name': 'statevector_simulator', 'backend_version': '1.1.0', 'basis_gates': ['u1', 'u2', 'u3', 'rz', 'sx', 'x', 'cx', 'id', 'unitary'], 'conditional': True, 'coupling_map': None, 'description': 'A Python statevector simulator for qobj files', 'gates': [{'name': 'u1', 'parameters': ['lambda'], 'qasm_def': 'gate u1(lambda) q { U(0,0,lambda) q; }'}, {'name': 'u2', 'parameters': ['phi', 'lambda'], 'qasm_def': 'gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }'}, {'name': 'u3', 'parameters': ['theta', 'phi', 'lambda'], 'qasm_def': 'gate u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }'}, {'name': 'rz', 'parameters': ['phi'], 'qasm_def': 'gate rz(phi) q { U(0,0,phi) q; }'}, {'name': 'sx', 'parameters': [], 'qasm_def': 'gate sx(phi) q { U(pi/2,7*pi/2,pi/2) q; }'}, {'name': 'x', 'parameters': [], 'qasm_def': 'gate x q { U(pi,7*pi/2,pi/2) q; }'}, {'name': 'cx', 'parameters': [], 'qasm_def': 'gate cx c,t { CX c,t; }'}, {'name': 'id', 'parameters': [], 'qasm_def': 'gate id a { U(0,0,0) a; }'}, {'name': 'unitary', 'parameters': ['matrix'], 'qasm_def': 'unitary(matrix) q1, q2,...'}], 'local': True, 'max_shots': 0, 'memory': True, 'n_qubits': 24, 'open_pulse': False, 'simulator': True, 'url': 'https://github.com/Qiskit/qiskit-terra'}#
- DEFAULT_OPTIONS = {'chop_threshold': 1e-15, 'initial_statevector': None}#
- MAX_QUBITS_MEMORY = 28#
- SHOW_FINAL_STATE = True#
- 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.
- version = 1#
Methods
- configuration()#
Return the backend configuration.
- রিটার্নস:
the configuration for the backend.
- রিটার্ন টাইপ:
- properties()#
Return the backend properties.
- রিটার্নস:
the configuration for the backend. If the backend does not support properties, it returns
None
.- রিটার্ন টাইপ:
- provider()#
Return the backend Provider.
- রিটার্নস:
the Provider responsible for the backend.
- রিটার্ন টাইপ:
- run(qobj, **backend_options)#
Run qobj asynchronously.
0.22.0_pending ভার্সন থেকে ডেপ্রিকেটেড: Using a qobj for the first argument to QasmSimulatorPy.run() is pending deprecation as of qiskit-terra 0.22.0. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date.
- প্যারামিটার:
- রিটার্নস:
derived from BaseJob
- রিটার্ন টাইপ:
- Additional Information:
- backend_options: Is a dict of options for the backend. It may contain
"initial_statevector": vector_like
The "initial_statevector" option specifies a custom initial initial statevector for the simulator to be used instead of the all zero state. This size of this vector must be correct for the number of qubits in all experiments in the qobj.
Example:
backend_options = { "initial_statevector": np.array([1, 0, 0, 1j]) / np.sqrt(2), }
- run_experiment(experiment)#
Run an experiment (circuit) and return a single experiment result.
- প্যারামিটার:
experiment (QobjExperiment) -- experiment from qobj experiments list
- রিটার্নস:
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": { "counts": {'0x9: 5, ...}, "memory": ['0x9', '0xF', '0x1D', ..., '0x9'] }, "status": status string for the simulation "success": boolean "time_taken": simulation time of this single experiment }
- রিটার্ন টাইপ:
- রেইজেস:
BasicAerError -- if an error occurred.
- 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.
- প্যারামিটার:
fields -- The fields to update the options
- রেইজেস:
AttributeError -- If the field passed in is not part of the options
- status()#
Return the backend status.
- রিটার্নস:
the status of the backend.
- রিটার্ন টাইপ: