Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Gheorghiu <[email protected]>
  • Loading branch information
vsoftco committed Sep 6, 2024
1 parent 9206ae3 commit f1c1746
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
11 changes: 8 additions & 3 deletions include/qpp/classes/qcircuit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6944,7 +6944,8 @@ circuit_as_iterators(const QCircuit& qc) {
* \brief Puts a quantum (sub)-circuit description in the canonical form,
* i.e., starting with the first measurement step in the circuit range
* [start, finish), pushes all cCTRLs and measurements to the end of the
* circuit, so the circuit will be of the form [Gates, cCTRLs, Measurements]
* circuit, so, if possible, the circuit will be of the form
* [Gates, cCTRLs, Measurements]
*
* \note This function does not interchange measurements, i.e., the re-ordering
* is stable
Expand Down Expand Up @@ -7009,8 +7010,12 @@ canonical_form(QCircuit::iterator start, QCircuit::iterator finish) {

/**
* \brief Puts a quantum (sub)-circuit description in the canonical form,
* i.e., starting with the first measurement step of the quantum circuit,
* pushes all measurements and cCTRLs at the end of the circuit
* i.e., starting with the first measurement step in the circuit, pushes all
* cCTRLs and measurements to the end of the circuit, so, if possible, the
* circuit will be of the form [Gates, cCTRLs, Measurements]
*
* \note This function does not interchange measurements, i.e., the re-ordering
* is stable
*
* \param qc Quantum circuit description
* \return Quantum circuit canonical form represented as a vector of quantum
Expand Down
13 changes: 7 additions & 6 deletions include/qpp/classes/qengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ class QEngineT : public QBaseEngine<T, QCircuit> {
* \param ensure_post_selection When \a ensure_post_selection is true, the
* step is executed repeatedly until the post-selection succeeds, or until
* the maximum number of post-selection reps is reached,
* \see qpp::QEngineT::set_max_post_selection_reps(), in which case the
* see qpp::QEngineT::set_max_post_selection_reps(), in which case the
* post-selection is not guaranteed to succeed; check the state of the
* engine, \see qpp::QEngineT::post_select_ok()
* engine, see qpp::QEngineT::post_select_ok()
*/
void
execute_circuit_steps_once_(const std::vector<QCircuit::iterator>& steps,
Expand Down Expand Up @@ -1015,7 +1015,8 @@ class QEngineT : public QBaseEngine<T, QCircuit> {
*
* \param dits Vector of classical dits, must have the same size as the
* internal vector of classical dits returned by
* qpp::QEngineT::get_dits() \return Reference to the current instance
* qpp::QEngineT::get_dits()
* \return Reference to the current instance
*/
QEngineT& set_dits(std::vector<idx> dits) {
// EXCEPTION CHECKS
Expand All @@ -1029,14 +1030,14 @@ class QEngineT : public QBaseEngine<T, QCircuit> {
}

/**
* \brief
* \brief Enforces post-selection (must succeed) when \a val is true
*
* \param val If true, repeatedly executes post-selection steps until the
* post-selection result(s) agree, or until the maximum number of
* post-selection repetitions is reached, \see
* post-selection repetitions is reached, see
* qpp::QEngineT::set_max_post_selection_reps(), in which case the
* post-selection is not guaranteed to succeed; check the state of the
* engine, \see qpp::QEngineT::post_select_ok().
* engine, see qpp::QEngineT::post_select_ok().
* \return Reference to the current instance
*/
QEngineT& set_ensure_post_selection(bool val) {
Expand Down
14 changes: 8 additions & 6 deletions include/qpp/internal/classes/qcircuit_conditional_step.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,22 @@ struct QCircuitConditionalStep : IDisplay {
* \brief Equality operator
*
* \param rhs qpp::internal::QCircuitConditionalStep against which the
* equality is being tested \return True if the
* qpp::internal::QCircuitConditionalStep(s) are equal, false otherwise
* equality is being tested
* \return True if the qpp::internal::QCircuitConditionalStep(s) are equal,
* false otherwise
*/
bool operator==(const QCircuitConditionalStep& rhs) const noexcept {
return std::tie(rhs.condition_type_) == std::tie(condition_type_);
return std::addressof(rhs.func_) == std::addressof(func_) &&
std::tie(rhs.condition_type_) == std::tie(condition_type_);
}

/**
* \brief Inequality operator
*
* \param rhs qpp::internal::QCircuitConditionalStep against which the
* inequality is being tested \return True if the
* qpp::internal::QCircuitConditionalStep(s) are not equal, false
otherwise
* inequality is being tested
* \return True if the qpp::internal::QCircuitConditionalStep(s) are not
* equal, false otherwise
*/
bool operator!=(const QCircuitConditionalStep& rhs) const noexcept {
return !(*this == rhs);
Expand Down

0 comments on commit f1c1746

Please sign in to comment.