Chapter 5. Quantum Information
The first three letters in the name Qiskit stand for quantum information science, which is the study of how quantum systems may be used to represent, process, and transmit information. The quantum_info module of Qiskit contains classes and functions that focus on those capabilities.
Using Quantum Information States
The qiskit.quantum_info module contains a few classes, shown in Table 5-1, that represent quantum information states.
| Class name | Description |
|---|---|
|
Represents a statevector |
|
Represents a density matrix |
|
Simulation of stabilizer circuits |
We’ll focus on the two most commonly used of these, namely the Statevector and DensityMatrix classes.
Using the Statevector Class
The Statevector class represents a quantum statevector and contains functionality for initializing and operating on the statevector. For example, as shown in the following code snippet, a Statevector may be instantiated by passing in a QuantumCircuit instance:
fromqiskitimportQuantumCircuitfromqiskit.quantum_infoimportStatevectorqc=QuantumCircuit(2)qc.h(0)qc.cx(0,1)statevector=Statevector(qc)(statevector.data)output:[0.70710678+0.j0.+0.j0.+0.j0.7071+0.j]
Notice that instead of running the circuit on a quantum simulator to get the statevector (as shown in the code in “Using the AerSimulator to calculate and hold a statevector” ...