| 478 | |
| 479 | template <NumQubitsFlag Targs, ArgsFlag Args> |
| 480 | auto getRandomRemainingArgs(vector<int> targs) { |
| 481 | |
| 482 | if constexpr (Args == none) |
| 483 | return tuple{ }; |
| 484 | |
| 485 | if constexpr (Args == scalar) { |
| 486 | qreal angle = getRandomPhase(); |
| 487 | return tuple{ angle }; |
| 488 | } |
| 489 | |
| 490 | if constexpr (Args == axisrots) { |
| 491 | qreal angle = getRandomPhase(); |
| 492 | qreal x = getRandomReal(-1, 1); |
| 493 | qreal y = getRandomReal(-1, 1); |
| 494 | qreal z = getRandomReal(-1, 1); |
| 495 | return tuple{ angle, x, y, z }; |
| 496 | } |
| 497 | |
| 498 | if constexpr (Args == compmatr || Args == diagmatr) { |
| 499 | auto matrix = getRandomApiMatrix<Targs,Args>(targs.size()); // allocates heap mem |
| 500 | return tuple{ matrix }; |
| 501 | } |
| 502 | |
| 503 | if constexpr (Args == diagpower) { |
| 504 | DiagMatr matrix = getRandomApiMatrix<Targs,Args>(targs.size()); // allocates heap mem |
| 505 | qcomp exponent = qcomp(getRandomReal(-3, 3), 0); // real for unitarity |
| 506 | return tuple{ matrix, exponent }; |
| 507 | } |
| 508 | |
| 509 | if constexpr (Args == paulistr) { |
| 510 | PauliStr str = getRandomPauliStr(targs); |
| 511 | return tuple{ str }; |
| 512 | } |
| 513 | |
| 514 | if constexpr (Args == pauligad) { |
| 515 | PauliStr str = getRandomPauliStr(targs); |
| 516 | qreal angle = getRandomPhase(); |
| 517 | return tuple{ str, angle }; |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | |
| 522 | template <NumQubitsFlag Targs, ArgsFlag Args> |
nothing calls this directly
no test coverage detected