| 703 | static const long dims = gate_traits<cnot>::dims; |
| 704 | |
| 705 | const qc_scalar_type operator() (long r, long c) const |
| 706 | { |
| 707 | unsigned long output; |
| 708 | // if the input control bit is set |
| 709 | if (control_mask&c) |
| 710 | { |
| 711 | output = c^target_mask; |
| 712 | } |
| 713 | else |
| 714 | { |
| 715 | output = c; |
| 716 | } |
| 717 | |
| 718 | if ((unsigned long)r == output) |
| 719 | return 1; |
| 720 | else |
| 721 | return 0; |
| 722 | } |
| 723 | |
| 724 | template <typename exp> |
| 725 | qc_scalar_type compute_state_element ( |
nothing calls this directly
no outgoing calls
no test coverage detected