qsim::HybridSimulator

#include <hybrid.h>

Hybrid Feynman-Schrodinger simulator.

Summary

Constructors and Destructors

HybridSimulator(Args &&... args)

Public types

Fuser using
FuserT< IO, GateHybrid >
Gate using
GateFused using
typename Fuser::GateFused
GateKind using
typename Gate::GateKind
fp_type using
typename Simulator::fp_type

Public functions

Run(const Parameter & param, HybridData & hd, const std::vector< unsigned > & parts, const std::vector< GateFused > & fgates0, const std::vector< GateFused > & fgates1, const std::vector< uint64_t > & bitstrings, std::vector< std::complex< fp_type >> & results) const
bool
Runs the hybrid simulator on a sectioned lattice.

Public static functions

SplitLattice(const std::vector< unsigned > & parts, const std::vector< Gate > & gates, HybridData & hd)
bool
Splits the lattice into two parts, using Schmidt decomposition for gates on the cut.

Structs

qsim::HybridSimulator::HybridData

Contextual data for hybrid simulation.

qsim::HybridSimulator::Parameter

User-specified parameters for gate fusion and hybrid simulation.

Public types

Fuser

FuserT< IO, GateHybrid > qsim::HybridSimulator::Fuser

Gate

GateT qsim::HybridSimulator::Gate

GateFused

typename Fuser::GateFused qsim::HybridSimulator::GateFused

GateKind

typename Gate::GateKind qsim::HybridSimulator::GateKind

fp_type

typename Simulator::fp_type qsim::HybridSimulator::fp_type

Public functions

HybridSimulator

 qsim::HybridSimulator::HybridSimulator(
  Args &&... args
)

Run

bool qsim::HybridSimulator::Run(
  const Parameter & param,
  HybridData & hd,
  const std::vector< unsigned > & parts,
  const std::vector< GateFused > & fgates0,
  const std::vector< GateFused > & fgates1,
  const std::vector< uint64_t > & bitstrings,
  std::vector< std::complex< fp_type >> & results
) const 

Runs the hybrid simulator on a sectioned lattice.

Details
Parameters
param
Options for parallelism and logging. Also specifies the size of the 'prefix' and 'root' sections of the lattice.
hd
Container object for gates on the boundary between lattice sections.
parts
Lattice sections to be simulated.
fgates0
List of gates from one section of the lattice.
fgates1
List of gates from the other section of the lattice.
bitstrings
List of output states to simulate, as bitstrings.
results
Output vector of amplitudes. After a successful run, this will be populated with amplitudes for each state in 'bitstrings'.
Returns
True if the simulation completed successfully; false otherwise.

Public static functions

SplitLattice

bool qsim::HybridSimulator::SplitLattice(
  const std::vector< unsigned > & parts,
  const std::vector< Gate > & gates,
  HybridData & hd
)

Splits the lattice into two parts, using Schmidt decomposition for gates on the cut.

Details
Parameters
parts
Lattice sections to be simulated.
gates
List of all gates in the circuit.
hd
Output data with splitted parts.
Returns
True if the splitting done successfully; false otherwise.