qsim::SimulatorBasic

#include <simulator_basic.h>

Quantum circuit simulator without vectorization.

Summary

Constructors and Destructors

SimulatorBasic(ForArgs &&... args)

Public types

State using
typename StateSpace::State
StateSpace using
fp_type using
typename StateSpace::fp_type

Public functions

ApplyControlledGate(const std::vector< unsigned > & qs, const std::vector< unsigned > & cqs, uint64_t cmask, const fp_type *matrix, State & state) const
void
Applies a controlled gate using non-vectorized instructions.
ApplyGate(const std::vector< unsigned > & qs, const fp_type *matrix, State & state) const
void
Applies a gate using non-vectorized instructions.
ExpectationValue(const std::vector< unsigned > & qs, const fp_type *matrix, const State & state) const
std::complex< double >
Computes the expectation value of an operator using non-vectorized instructions.
SIMDRegisterSize()
unsigned

Public types

State

typename StateSpace::State State

StateSpace

StateSpaceBasic< For, FP > StateSpace

fp_type

typename StateSpace::fp_type fp_type

Public functions

ApplyControlledGate

void ApplyControlledGate(
  const std::vector< unsigned > & qs,
  const std::vector< unsigned > & cqs,
  uint64_t cmask,
  const fp_type *matrix,
  State & state
) const 

Applies a controlled gate using non-vectorized instructions.

Details
Parameters
qs
Indices of the qubits affected by this gate.
cqs
Indices of control qubits.
cmask
Bit mask of control qubit values.
matrix
Matrix representation of the gate to be applied.
state
The state of the system, to be updated by this method.

ApplyGate

void ApplyGate(
  const std::vector< unsigned > & qs,
  const fp_type *matrix,
  State & state
) const 

Applies a gate using non-vectorized instructions.

Details
Parameters
qs
Indices of the qubits affected by this gate.
matrix
Matrix representation of the gate to be applied.
state
The state of the system, to be updated by this method.

ExpectationValue

std::complex< double > ExpectationValue(
  const std::vector< unsigned > & qs,
  const fp_type *matrix,
  const State & state
) const 

Computes the expectation value of an operator using non-vectorized instructions.

Details
Parameters
qs
Indices of the qubits the operator acts on.
matrix
The operator matrix.
state
The state of the system.
Returns
The computed expectation value.

SIMDRegisterSize

unsigned SIMDRegisterSize()

Details
Returns
The size of SIMD register if applicable.

SimulatorBasic

 SimulatorBasic(
  ForArgs &&... args
)