MCPcopy Create free account
hub / github.com/davisking/dlib / hadamard

Function hadamard

dlib/quantum_computing/quantum_computing.h:624–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622 {
623
624 inline const gate<1> hadamard(
625 )
626 {
627 gate<1> h;
628 h(0,0) = std::sqrt(1/2.0);
629 h(0,1) = std::sqrt(1/2.0);
630 h(1,0) = std::sqrt(1/2.0);
631 h(1,1) = -std::sqrt(1/2.0);
632 return h;
633 }
634
635 // ------------------------------------------------------------------------------------
636

Callers 3

shor_encodeFunction · 0.85
shor_decodeFunction · 0.85
mainFunction · 0.85

Calls 1

sqrtFunction · 0.50

Tested by

no test coverage detected