Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Utils::Sampling Namespace Reference

Classes

struct  Options
class  Prepared
class  ProbabilityAlias

Typedefs

template<bool Many>
using Counts = std::unordered_map<std::conditional_t<Many, std::vector<bool>, Types::qubit_t>, Types::qubit_t>

Enumerations

enum class  Family {
  Auto ,
  Cdf ,
  Alias
}

Functions

void CheckMass (double total)
template<bool Many, class Plan, class Bit, class Uniform>
Counts< Many > Count (const Plan &plan, size_t shots, size_t bits, const Bit &bit, Uniform &&uniform)
template<bool Many, class Range, class Probability, class Bit, class Uniform>
Counts< Many > CountCdfRange (const Range &rows, size_t shots, size_t bits, const Probability &probability, const Bit &bit, Uniform &&uniform, Options options={})
template<bool Many, class Bit>
Counts< Many > Single (size_t bits, const Bit &bit)
int Threads (bool permitted, size_t work)
template<class Qubits>
void ValidateQubits (const Qubits &qubits, size_t width, bool many)
bool ValidateSetting (std::string_view name, std::string_view setting)

Class Documentation

◆ Utils::Sampling::Options

struct Utils::Sampling::Options

Definition at line 35 of file Sampling.h.

Collaboration diagram for Utils::Sampling::Options:
Class Members
size_t batchSize = size_t{1} << 20
Family family = Family::Auto
size_t memoryBytes = size_t{256} << 20
bool multithreading = false

Typedef Documentation

◆ Counts

template<bool Many>
using Utils::Sampling::Counts = std::unordered_map<std::conditional_t<Many, std::vector<bool>, Types::qubit_t>, Types::qubit_t>

Definition at line 373 of file Sampling.h.

Enumeration Type Documentation

◆ Family

enum class Utils::Sampling::Family
strong
Enumerator
Auto 
Cdf 
Alias 

Definition at line 28 of file Sampling.h.

Function Documentation

◆ CheckMass()

void Utils::Sampling::CheckMass ( double total)
inline

Definition at line 80 of file Sampling.h.

◆ Count()

template<bool Many, class Plan, class Bit, class Uniform>
Counts< Many > Utils::Sampling::Count ( const Plan & plan,
size_t shots,
size_t bits,
const Bit & bit,
Uniform && uniform )

Definition at line 472 of file Sampling.h.

References Alias, and Threads().

◆ CountCdfRange()

template<bool Many, class Range, class Probability, class Bit, class Uniform>
Counts< Many > Utils::Sampling::CountCdfRange ( const Range & rows,
size_t shots,
size_t bits,
const Probability & probability,
const Bit & bit,
Uniform && uniform,
Options options = {} )

Definition at line 407 of file Sampling.h.

References Probability().

◆ Single()

template<bool Many, class Bit>
Counts< Many > Utils::Sampling::Single ( size_t bits,
const Bit & bit )

Definition at line 375 of file Sampling.h.

◆ Threads()

int Utils::Sampling::Threads ( bool permitted,
size_t work )
inline

Definition at line 65 of file Sampling.h.

Referenced by Count().

◆ ValidateQubits()

template<class Qubits>
void Utils::Sampling::ValidateQubits ( const Qubits & qubits,
size_t width,
bool many )

Definition at line 394 of file Sampling.h.

◆ ValidateSetting()

bool Utils::Sampling::ValidateSetting ( std::string_view name,
std::string_view setting )
inline

Definition at line 45 of file Sampling.h.