state_preparation#
Functionality#
Compared to complete quantum algorithms, this module collects a family of quantum state preparation subroutines that can be used to initialize specific quantum states for various quantum algorithms.
graph_state.py#
Callee: GraphState
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
Such a state can be prepared by first preparing all qubits in the \(\ket{+}\) state, then applying a \(CZ\) 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 [4].
w_state.py#
Callee: WState
Circuit to prepare a W state.
A W state is an entangled quantum state of multiple qubits where a single excitation is delocalized over all qubits. For n qubits, the W state is represented as:
ghz_state.py#
Callee: GHZState
Circuit to prepare a GHZ state.
A GHZ (Greenberger-Horne-Zeilinger) state is a type of entangled quantum state that involves multiple qubits. For n qubits, the GHZ state is represented as:
API#
qolumbina.programs.state_preparation.ghz_state#
GHZ benchmark definition.
- class GHZState(num_qubits, name=None)[source]#
Bases:
QuantumCircuitCreate a Greenberger-Horne-Zeilinger (GHZ) State: A GHZ state is an entangled quantum state of multiple qubits where all qubits are in a superposition of all being 0 or all being 1.
- Parameters:
num_qubits (int) – Number of qubits of the GHZ state.
name (str | None) – Name of the quantum circuit.
qolumbina.programs.state_preparation.graph_state#
Graph State circuit and gate.
- class GraphState(adjacency_matrix)[source]#
Bases:
QuantumCircuitCircuit 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\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 \(CZ\) 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:
(
Source code,png,hires.png,pdf)
References:
- [1] M. Hein, J. Eisert, H.J. Briegel, Multi-party Entanglement in Graph States,
- [2] D. Koh, Further Extensions of Clifford Circuits & their Classical Simulation Complexities.
Create graph state preparation circuit.
- Parameters:
adjacency_matrix (list | np.ndarray) – Adjacency matrix representing the graph, which is presented in a form of \(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.
- class GraphStateGate(adjacency_matrix)[source]#
Bases:
GateA gate representing a graph state.
- Parameters:
adjacency_matrix (list | np.ndarray) – Adjacency matrix representing the graph, which is presented in a form of \(n\)-by-\(n\) list of 0-1 lists.
- Raises:
CircuitError – If adjacency_matrix is not symmetric.
The gate represents a graph state with the given adjacency matrix.
- property adjacency_matrix#
Returns the adjacency matrix.
W state benchmark definition.
- class WState(num_qubits, name=None)[source]#
Bases:
QuantumCircuitCreate a W State: A W state is an entangled quantum state of multiple qubits where a single excitation is delocalized over all qubits.
- Parameters:
num_qubits (int) – Number of qubits of the W state
name (str | None) – Name of the quantum circuit