The PennyLane-Qiskit plugin integrates the Qiskit quantum computing framework with PennyLane’s quantum machine learning capabilities.
PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
Qiskit is an open-source framework for quantum computing.
Once the PennyLane-Qiskit plugin is installed, the the Qiskit devices can be accessed straightaway in PennyLane, without the need to import new packages.
Currently, there are three different devices available:
For example, the
'qiskit.aer' device with two wires is called like this:
import pennylane as qml
dev = qml.device('qiskit.aer', wires=2)
Qiskit devices have different backends, which define which actual simulator or hardware is used by the device. Different simulator backends are optimized for different types of circuits. A backend can be defined as follows:
dev = qml.device('qiskit.aer', wires=2, backend='unitary_simulator')
PennyLane chooses the
qasm_simulator as the default backend if no backend is specified.
For more details on the
qasm_simulator, including available backend options, see
Qiskit Qasm Simulator documentation.
Check out these demos to see the PennyLane-Qiskit plugin in action: