#include <qgame++.h>
Public Member Functions | |
void | init (int numQubits, QProgram *prg, const std::string &oracleTT) |
Initialize a quantum system with the provided data, setting the register to |00..0> and installing the truth table to the oracle gates found in prg. | |
QSys * | clone (double priorProb) |
Return a new QSys object that is a clone of the current one, and has the given prior probability. | |
Qureg | getReg () |
Get contents of the system's quantum register. | |
void | setReg (const Qureg &) |
Set the system's quantum register. | |
double | getProb () |
Get prior probability of quantum system. | |
void | setProb (double prob) |
Set prior probability of quantum system. | |
int | getOracleCount () |
Get the number of oracle calls in the history of this system. | |
std::vector< Measurement > | getMeasurementHistory () |
Get the measurement history of the system. | |
void | apply (QGate *, const QubitList &) throw (Error) |
Apply a QGate to the given qubits. | |
void | apply (const QInstr &) throw (Error) |
Apply an instruction given as a string. | |
Static Public Member Functions | |
std::vector< QSys * > | execute (int numQubits, QProgram *prg, const std::string &oracleTT) throw (Error) |
Execute the given program and return a list of pointers to the resulting QSys objects, each with its own measurement history and resulting prior probability. | |
Result | testProgram (int numQubits, QProgram *prg, const std::vector< TestCase > &cases, const QubitList &finalMeasure, double threshold) throw (Error) |
Perform a number of test runs on the provided test cases as described in the class description, and return stats as a result. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const QSys &) |
The core of a quantum system is a quantum register containing a certain number of qubits, which are being manipulated by a quantum program given as a QProgram object. A QSys object can be cloned (a functionality that is mostly used for executing different branches after a measurement). There are two main ways to run a program; both involve calling a static method:
Definition at line 82 of file qgame++.h.
|
Apply an instruction given as a string. Instructions that do not contain gates, such as control flow instructions or measurements, will be ignored. Definition at line 114 of file qgame++.cpp. |
|
Execute the given program and return a list of pointers to the resulting QSys objects, each with its own measurement history and resulting prior probability. You have to take care of deleting the QSys objects yourself if they are no longer needed. Definition at line 124 of file qgame++.cpp. |
|
Perform a number of test runs on the provided test cases as described in the class description, and return stats as a result.
Definition at line 217 of file qgame++.cpp. References qgame::Result::avgError, qgame::Result::avgExpOracles, qgame::TestCase::desiredRes, qgame::Result::maxError, qgame::Result::maxExpOracles, qgame::Result::misses, and qgame::TestCase::oracleTT. |