Skip to main contentIBM Quantum Documentation Mirror

GraphState

class qiskit.circuit.library.GraphState(adjacency_matrix)

GitHub

Bases: QuantumCircuit

Circuit to prepare a graph state.

Given a graph G = (V, E), with the set of vertices V and the set of edges E, the corresponding graph state is defined as

G=(a,b)ECZ(a,b)+V|G\rangle = \prod_{(a,b) \in E} CZ_{(a,b)} {|+\rangle}^{\otimes V}

Such a state can be prepared by first preparing all qubits in the ++ state, then applying a CZCZ gate for each corresponding graph edge.

Graph state preparation circuits are Clifford circuits, and thus easy to simulate classically. However, by adding a layer of measurements in a product basis at the end, there is evidence that the circuit becomes hard to simulate [2].

Reference Circuit:

Diagram illustrating the previously described circuit.

References:

[1] M. Hein, J. Eisert, H.J. Briegel, Multi-party Entanglement in Graph States,

arXiv:0307130

[2] D. Koh, Further Extensions of Clifford Circuits & their Classical Simulation Complexities.

arXiv:1512.07892

Create graph state preparation circuit.

Deprecated since version 2.1

The class qiskit.circuit.library.graph_state.GraphState is deprecated as of Qiskit 2.1. It will be removed in Qiskit 3.0. Use qiskit.circuit.library.GraphStateGate instead.

Parameters

adjacency_matrix (list | np.ndarray) – input graph as n-by-n list of 0-1 lists

Raises

CircuitError – If adjacency_matrix is not symmetric.

The circuit prepares a graph state with the given adjacency matrix.


Attributes

name

Type: str

A human-readable name for the circuit.

Example

from qiskit import QuantumCircuit
 
qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit