diff --git a/include/qpp/classes/qcircuit.hpp b/include/qpp/classes/qcircuit.hpp index d025244ca..2df773e7b 100644 --- a/include/qpp/classes/qcircuit.hpp +++ b/include/qpp/classes/qcircuit.hpp @@ -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 @@ -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 diff --git a/include/qpp/classes/qengine.hpp b/include/qpp/classes/qengine.hpp index 050f3fc2b..15dec110c 100644 --- a/include/qpp/classes/qengine.hpp +++ b/include/qpp/classes/qengine.hpp @@ -215,9 +215,9 @@ class QEngineT : public QBaseEngine { * \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& steps, @@ -1015,7 +1015,8 @@ class QEngineT : public QBaseEngine { * * \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 dits) { // EXCEPTION CHECKS @@ -1029,14 +1030,14 @@ class QEngineT : public QBaseEngine { } /** - * \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) { diff --git a/include/qpp/internal/classes/qcircuit_conditional_step.hpp b/include/qpp/internal/classes/qcircuit_conditional_step.hpp index c09e67538..fb2aa8579 100644 --- a/include/qpp/internal/classes/qcircuit_conditional_step.hpp +++ b/include/qpp/internal/classes/qcircuit_conditional_step.hpp @@ -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);