1313
1414namespace cudaq ::qec {
1515
16- // / @brief A sliding window decoder that processes syndromes in overlapping windows
17- // /
18- // / This decoder divides the syndrome stream into overlapping windows and decodes each
19- // / window independently using an inner decoder. It's designed for low-latency decoding
20- // / of streaming syndrome data.
16+ // / @brief A sliding window decoder that processes syndromes in overlapping
17+ // / windows
18+ // /
19+ // / This decoder divides the syndrome stream into overlapping windows and
20+ // / decodes each window independently using an inner decoder. It's designed for
21+ // / low-latency decoding of streaming syndrome data.
2122class sliding_window : public decoder {
2223private:
2324 // --- Input parameters ---
@@ -80,29 +81,32 @@ class sliding_window : public decoder {
8081
8182 // / @brief Validate constructor inputs
8283 void validate_inputs ();
83-
84+
8485 // / @brief Initialize the window
8586 // / @param num_syndromes The number of syndromes to initialize the window for
8687 void initialize_window (std::size_t num_syndromes);
87-
88+
8889 // / @brief Add a single syndrome to the rolling window (circular buffer)
8990 void add_syndrome_to_rolling_window (const std::vector<float_t > &syndrome,
90- std::size_t syndrome_index,
91- bool update_next_write_index = true );
92-
91+ std::size_t syndrome_index,
92+ bool update_next_write_index = true );
93+
9394 // / @brief Add a batch of syndromes to the rolling window (circular buffer)
9495 void add_syndromes_to_rolling_window (
9596 const std::vector<std::vector<float_t >> &syndromes);
96-
97- // / @brief Get a single syndrome from the rolling window (unwrapping circular buffer)
98- std::vector<float_t > get_syndrome_from_rolling_window (std::size_t syndrome_index);
99-
100- // / @brief Get a batch of syndromes from the rolling window (unwrapping circular buffer)
97+
98+ // / @brief Get a single syndrome from the rolling window (unwrapping circular
99+ // / buffer)
100+ std::vector<float_t >
101+ get_syndrome_from_rolling_window (std::size_t syndrome_index);
102+
103+ // / @brief Get a batch of syndromes from the rolling window (unwrapping
104+ // / circular buffer)
101105 std::vector<std::vector<float_t >> get_syndromes_from_rolling_window ();
102-
106+
103107 // / @brief Update the read index for the rolling window
104108 void update_rw_next_read_index ();
105-
109+
106110 // / @brief Decode a single window (internal helper)
107111 void decode_window ();
108112
@@ -127,7 +131,8 @@ class sliding_window : public decoder {
127131 // / @brief Decode multiple syndromes in batch
128132 // / @param syndromes Multiple syndrome measurements to decode
129133 // / @return The decoded error corrections
130- std::vector<decoder_result> decode_batch (const std::vector<std::vector<float_t >> &syndromes) override ;
134+ std::vector<decoder_result>
135+ decode_batch (const std::vector<std::vector<float_t >> &syndromes) override ;
131136
132137 // / @brief Get the number of syndromes per round
133138 // / @return The number of syndromes measured in each round
@@ -146,4 +151,3 @@ class sliding_window : public decoder {
146151};
147152
148153} // namespace cudaq::qec
149-
0 commit comments