Class QuantumStateBase

Inheritance Relationships

Derived Types

Class Documentation

class QuantumStateBase

Subclassed by DensityMatrixCpu, QuantumStateCpu

Public Functions

inline QuantumStateBase(UINT qubit_count_, bool is_state_vector)
inline QuantumStateBase(UINT qubit_count_, bool is_state_vector, int use_multi_cpu)
inline QuantumStateBase(UINT qubit_count_, bool is_state_vector, UINT device_number_)
inline virtual ~QuantumStateBase()
inline virtual bool is_state_vector() const
virtual void set_zero_state() = 0
virtual void set_zero_norm_state() = 0
virtual void set_computational_basis(ITYPE comp_basis) = 0
virtual void set_Haar_random_state() = 0
virtual void set_Haar_random_state(UINT seed) = 0
virtual double get_zero_probability(UINT target_qubit_index) const = 0
virtual double get_marginal_probability(std::vector<UINT> measured_values) const = 0
virtual double get_entropy() const = 0
virtual double get_squared_norm() const = 0
virtual double get_squared_norm_single_thread() const = 0
virtual void normalize(double squared_norm) = 0
virtual void normalize_single_thread(double squared_norm) = 0
virtual QuantumStateBase *allocate_buffer() const = 0
virtual QuantumStateBase *copy() const = 0
virtual void load(const QuantumStateBase *state) = 0
virtual void load(const std::vector<CPPCTYPE> &state) = 0
virtual void load(const CPPCTYPE *state) = 0
virtual const std::string get_device_name() const = 0
virtual void *data() const = 0
virtual CPPCTYPE *data_cpp() const = 0
virtual CTYPE *data_c() const = 0
virtual CPPCTYPE *duplicate_data_cpp() const = 0
virtual CTYPE *duplicate_data_c() const = 0
virtual void add_state(const QuantumStateBase *state) = 0
virtual void add_state_with_coef(CPPCTYPE coef, const QuantumStateBase *state) = 0
virtual void add_state_with_coef_single_thread(CPPCTYPE coef, const QuantumStateBase *state) = 0
virtual void multiply_coef(CPPCTYPE coef) = 0
virtual void multiply_elementwise_function(const std::function<CPPCTYPE(ITYPE)> &func) = 0
inline virtual UINT get_classical_value(UINT index)
inline virtual void set_classical_value(UINT index, UINT val)
inline virtual const std::vector<UINT> get_classical_register() const
virtual std::vector<ITYPE> sampling(UINT sampling_count) = 0
virtual std::vector<ITYPE> sampling(UINT sampling_count, UINT random_seed) = 0
virtual boost::property_tree::ptree to_ptree() const = 0
inline virtual std::string to_string() const
inline virtual void *get_cuda_stream() const

Public Members

const UINT &qubit_count
const UINT &inner_qc
const UINT &outer_qc
const ITYPE &dim
const std::vector<UINT> &classical_register
const UINT &device_number

Protected Attributes

ITYPE _dim
UINT _qubit_count
UINT _inner_qc
UINT _outer_qc
bool _is_state_vector
std::vector<UINT> _classical_register
UINT _device_number
void *_cuda_stream

Friends

inline friend std::ostream &operator<<(std::ostream &os, const QuantumStateBase &state)
inline friend std::ostream &operator<<(std::ostream &os, const QuantumStateBase *state)