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

\[ \ket{G} = \prod_{(a,b) \in E} CZ_{a,b} \ket{+}^{\otimes |V|}, \]

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].

Doc references: [48], [49]


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:

\[ \ket{W}_n = \frac{1}{\sqrt{n}}(\ket{100\cdots0} + \ket{010\cdots0} + \cdots + \ket{000\cdots1}) \]

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:

\[ \ket{GHZ}_n = \frac{1}{\sqrt{2}}(|00\cdots0\rangle + |11\cdots1\rangle). \]

API#

qolumbina.programs.state_preparation.ghz_state#

GHZ benchmark definition.

class GHZState(num_qubits, name=None)[source]#

Bases: QuantumCircuit

Create 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: 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\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)

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.

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: Gate

A 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.

validate_parameter(parameter)[source]#

Parameter validation

W state benchmark definition.

class WState(num_qubits, name=None)[source]#

Bases: QuantumCircuit

Create 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

f_gate(qc, i, j, n, k)[source]#
Parameters:
  • qc (QuantumCircuit)

  • i (int)

  • j (int)

  • n (int)

  • k (int)

Return type:

None