hqcsim-0.1.0.0: A library for simulating quantum circuits.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Quantum.QDataTypes

Description

 
Synopsis

Documentation

type State = Vector (Complex Double) Source #

The State type is an alias for a vector of complex numbers.

In the context of quantum computing, a State represents a quantum state as a column vector where each element is a complex number. The length of the vector is typically \(2^n\) for a system of n qubits.

For example, a State could be:

 [1 :+ 0, 0 :+ 0, 0 :+ 0, 0 :+ 0]  -- Represents |0⟩

type Gate = Matrix (Complex Double) Source #

The Gate type is an alias for a matrix of complex numbers.

In quantum computing, a Gate is a unitary matrix that represents a quantum operation applied to qubits. The matrix elements are complex numbers.

The Gate type is used to describe quantum gates in algorithms. For example:

-- Represents a 2x2 Hadamard Gate
hGate :: Gate
hGate = (2LA.><2)
  [1sqrt 2,1sqrt 2,1sqrt 2,(-1)sqrt 2] :: Gate