Quantum Framework
PennyLane
PennyLane is Xanadu's open-source framework specializing in quantum machine learning, quantum chemistry, and optimization. It uses an automatic differentiation ("autograd") approach that allows gradients of quantum circuits to be computed for training variational algorithms (VQE, QAOA, QNNs). Supports a wide range of hardware backends via plugins.
Overview
Maintainer
Xanadu
Language(s)
Version
0.x
Supported Architectures
Cloud Platforms
Installation
pip install pennylane # For hardware backends: pip install pennylane-qiskit pennylane-cirq
Requires Python 3.10+. The base `pennylane` package includes the `default.qubit` simulator. Hardware plugins (`pennylane-qiskit`, `pennylane-cirq`) require their respective credentials. For AWS Braket: `pip install amazon-braket-pennylane-plugin`. JAX, PyTorch, or TensorFlow can be used as the autodiff backend.
Bell State Example
A Bell state (maximally entangled two-qubit state) is the canonical first circuit for any quantum framework.
import pennylane as qml
dev = qml.device('default.qubit', wires=2)
@qml.qnode(dev)
def bell_circuit():
qml.Hadamard(wires=0)
qml.CNOT(wires=[0, 1])
return qml.probs(wires=[0, 1])
probs = bell_circuit()
print(probs) # [0.5, 0., 0., 0.5]
# Switch to IBM Quantum hardware:
# dev = qml.device('qiskit.ibmq', wires=2,
# backend='ibmq_manila',
# ibmqx_token='YOUR_TOKEN')Cloud Access
PennyLane connects to hardware via device plugins. AWS Braket is accessible natively (`amazon-braket-pennylane-plugin`). IBM Quantum hardware is available via `pennylane-qiskit`. The framework's gradient computation works end-to-end through hardware, enabling variational algorithm training directly on QPUs.
Provider Compatibility
| Provider | Access Method | Notes |
|---|---|---|
| IBM Quantum | pennylane-qiskit plugin | pip install pennylane-qiskit; uses Qiskit Runtime under the hood |
| Amazon Braket | amazon-braket-pennylane-plugin (native) | pip install amazon-braket-pennylane-plugin; supports all Braket QPUs |
| Azure Quantum | pennylane-azure plugin | Access IonQ and Quantinuum via Azure Quantum workspace |
| Xanadu (Borealis) | strawberryfields plugin | For photonic QC; pip install pennylane-sf |


