mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-02 08:23:10 +08:00
add Quantum Computing category intro
Its meta description fell back to generic text and readers got no guidance on which library to pick. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
Qiskit for most circuits, PennyLane for circuits you train, Cirq for device-level control, QuTiP for physics: Python quantum computing libraries you can mix.
|
||||
|
||||
How to choose:
|
||||
|
||||
- Most circuit work, including IBM hardware: Qiskit
|
||||
- Circuits you train with gradients, like quantum machine learning: PennyLane
|
||||
- Device-level control over circuits and noise: Cirq
|
||||
- Simulating the dynamics of open quantum systems: QuTiP
|
||||
|
||||
Qiskit is an [SDK for working with quantum computers](https://github.com/Qiskit/qiskit) at the level of circuits, operators, and primitives. Its docs lay out the development workflow as a [Qiskit pattern](https://quantum.cloud.ibm.com/docs/en/guides/intro-to-patterns): map your problem to circuits, optimize them for the target hardware, run them, and post-process the results. Run circuits through the [Sampler and Estimator primitives](https://quantum.cloud.ibm.com/docs/en/guides/primitives). Sampler samples outcomes, and Estimator estimates expectation values. Before a circuit goes to a device, [transpile it](https://quantum.cloud.ibm.com/docs/en/guides/transpile) to the gates and qubit connections that device supports. Test it in [local testing mode](https://quantum.cloud.ibm.com/docs/en/guides/local-testing-mode) first: once your program works there, moving to a QPU takes only a backend name change.
|
||||
|
||||
PennyLane lets you [train a quantum computer the same way as a neural network](https://docs.pennylane.ai/en/stable/): it differentiates quantum circuits and connects them to PyTorch, JAX, and NumPy. Write each circuit as a Python function under the [`qnode` decorator](https://docs.pennylane.ai/en/stable/introduction/circuits.html#the-qnode-decorator), which ties it to the device that runs it. Pick the [interface](https://docs.pennylane.ai/en/stable/introduction/interfaces.html) for your machine learning library, then train with that library's own optimizers.
|
||||
|
||||
Cirq is for [writing, manipulating, and optimizing quantum circuits](https://quantumai.google/cirq) when the details of the hardware matter. A circuit is [a collection of Moments](https://quantumai.google/cirq/build/circuits), each a set of operations that act in the same time slice. Model your target processor as a [Device](https://quantumai.google/cirq/hardware/devices) and validate your circuits against it. Then [compile them with transformers](https://quantumai.google/cirq/transform/transformers) into circuits that device can run. Test small circuits on the [built-in simulators](https://quantumai.google/cirq/simulate/simulation), then move to qsim, which its docs recommend for most users. Before Google hardware, run on the [Quantum Virtual Machine](https://quantumai.google/cirq/simulate/quantum_virtual_machine), which mimics Google's processors with noise data.
|
||||
|
||||
QuTiP [simulates the dynamics of open quantum systems](https://qutip.org/), like the ones in quantum optics, trapped ions, and superconducting circuits. Every state and operator is a [`Qobj`](https://qutip.readthedocs.io/en/stable/guide/guide-basics.html), and QuTiP has predefined ones for a variety of them. Pick the solver [by the kind of system](https://qutip.readthedocs.io/en/stable/guide/dynamics/dynamics-intro.html): a closed system is a state vector, and an open one needs a density matrix. [`mesolve`](https://qutip.readthedocs.io/en/stable/guide/dynamics/dynamics-master.html) covers both, and switches to the master equation when you give it collapse operators. For large systems, the docs recommend the [Monte Carlo solver](https://qutip.readthedocs.io/en/stable/guide/dynamics/dynamics-monte.html). To simulate quantum circuits, use its [qutip-qip](https://qutip.readthedocs.io/en/stable/guide/guide-family.html) package.
|
||||
|
||||
You don't have to stay with one library. PennyLane [imports Qiskit circuits](https://docs.pennylane.ai/en/stable/introduction/circuits.html#importing-circuits-from-other-frameworks), and its plugins run on [Qiskit devices](https://docs.pennylane.ai/projects/qiskit/en/stable/) and [Cirq's simulators](https://docs.pennylane.ai/projects/cirq/en/stable/). QuTiP's qutip-qip [simulates circuits made in Qiskit](https://qutip-qip.readthedocs.io/en/stable/qip-qiskit.html).
|
||||
Reference in New Issue
Block a user