Module Naive.NaiveBackend

A simple quantum circuit simulation backend based on Qubit-Wise Multiplication.

type qstate = Stdlib.Complex.t array
val iteration_indices : int -> int -> int * int

Returns the indices of the state amplitudes required for the ith iteration of a gate on target t.

val init : int -> Stdlib.Complex.t array

Initialises a state vector given a number of qubits.

val controls_check : int -> Circuit.adr list -> bool

Check if an iteration should execute based on the controls of the gate.

type matrix = Stdlib.Complex.t * Stdlib.Complex.t * Stdlib.Complex.t * Stdlib.Complex.t
val cpx_2 : Stdlib.Complex.t
val cpx_inv_sqrt_2 : Stdlib.Complex.t
val cpx_2_pi : Stdlib.Complex.t
val cpx_pow_2 : int -> Stdlib.Complex.t
val matrix_for_gate : Circuit.gate_kind -> matrix

Returns the matrix corresponding to a gate.

val apply_gate : Circuit.gate -> qstate -> unit
val repr : 'a -> 'b