MCPcopy Create free account
hub / github.com/davisking/dlib / operator()

Method operator()

dlib/quantum_computing/quantum_computing.h:705–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected