| 220 | |
| 221 | template <typename exp> |
| 222 | qc_scalar_type compute_state_element ( |
| 223 | const matrix_exp<exp>& reg, |
| 224 | long row_idx |
| 225 | ) const |
| 226 | { |
| 227 | qc_scalar_type temp = sum(reg)*2.0/dims; |
| 228 | // compute this value: temp = temp - reg(row_idx)*2.0/dims + reg(row_idx)*(2.0/dims - 1.0) |
| 229 | temp = temp - reg(row_idx); |
| 230 | |
| 231 | return temp; |
| 232 | } |
| 233 | }; |
| 234 | |
| 235 | // ---------------------------------------------------------------------------------------- |