C++ core
-
namespace core
-
class CppCore
- #include <cpp_core.hpp>
Subclassed by mindquantum::python::CppCore
Public Types
-
using circuit_t = td::Circuit
-
using instruction_t = CircuitManager::instruction_t
-
using Complex = std::complex<double>
-
using c_type = std::complex<double>
Public Functions
-
CppCore()
-
inline bool sim_backend() const
-
void set_engine_list(const engine_list_t &engine_list)
-
void set_simulator_backend(::projectq::Simulator &sim)
-
void allocate_qubit(unsigned id)
Allocate a single qubit.
-
void flush()
Execute stored gates.
-
void traverse_engine_list()
Go through all engines in engine_list_.
Gets called in beginning of flush()
-
std::map<unsigned, bool> get_measure_info()
Return measurement outcomes.
- Returns
A map where the key values are the measured qubits’ IDs and the mapped values are the measurement outcomes
-
void set_output_stream(std::string_view file_name)
Set output file name (stdout for printing to standard output)
-
void write(std::string_view format)
Output Quantum circuit to standard output.
- Parameters
format – in which to output circuit
-
inline auto cheat()
Return state vector.
- Returns
A map where the key values are the allocated qubits’ ids and the mapped values are their positions in the ket: |q_n, q_(n-1), …, q_1, q_0>
- Returns
The current state vector of the allocated qubits
-
using circuit_t = td::Circuit
-
class CppCore