| 218 | |
| 219 | |
| 220 | qmatrix getOuterProduct(qvector ket, qvector bra) { |
| 221 | DEMAND( bra.size() == ket.size() ); |
| 222 | |
| 223 | qmatrix out = getZeroMatrix(bra.size()); |
| 224 | |
| 225 | for (size_t i=0; i<ket.size(); i++) |
| 226 | for (size_t j=0; j<ket.size(); j++) |
| 227 | out[i][j] = ket[i] * std::conj(bra[j]); |
| 228 | |
| 229 | return out; |
| 230 | } |
| 231 | |
| 232 | |
| 233 |
no test coverage detected