ket.ibm¶
Module providing functionality to interact with IBM Quantum and IBM Cloud devices.
Note
This module requires additional dependencies from ket-lang[ibm].
Install with: pip install ket-lang[ibm].
Classes ket.ibm¶
IBM Qiskit backend for Ket process. |
- class IBMDevice(backend: BackendV2 | None = None, optimization_level=2)¶
IBM Qiskit backend for Ket process.
The arguments
shotsandclassical_shadowscontrol how the execution is performed for estimating expectation values of an Hamiltonian term. Only one of these arguments can be specified at a time.- Parameters:
backend – The backend to be used for the quantum execution. If not provided, it defaults to the AerSimulator.
- clear()¶
Clear the data to start a new execution.
Warning
This method is called by Libket and should not be called directly.
- submit_execution(circuit, parameters)¶
Get the quantum circuit to execute.
Warning
This method is called by Libket and should not be called directly.
- get_result()¶
Get the result of the quantum circuit execution.
Warning
This method is called by Libket and should not be called directly.
- pauli_x(target, control)¶
Apply a Pauli-X gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- pauli_y(target, control)¶
Apply a Pauli-Y gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- pauli_z(target, control)¶
Apply a Pauli-Z gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- hadamard(target, control)¶
Apply a Hadamard gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- rotation_x(target, control, **kwargs)¶
Apply a X-Rotation gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- rotation_y(target, control, **kwargs)¶
Apply a Y-Rotation gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- rotation_z(target, control, **kwargs)¶
Apply a Z-Rotation gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- phase(target, control, **kwargs)¶
Apply a Phase gate to the target qubit.
Warning
This method is called by Libket and should not be called directly.
- sample(_, qubits, shots)¶
Sample the qubits.
Warning
This method is called by Libket and should not be called directly.
- exp_value(_, hamiltonian)¶
Compute the expectation value.
Warning
This method is called by Libket and should not be called directly.