#set page( paper: "a4", header: align(center)[ QCS - DM2 - Augustin LUCAS ], ) == Q1 We want to *simplify* the following circuit: #{ import "@preview/quill:0.4.0": * quantum-circuit( lstick($|v_0〉$), $H$, ctrl(1), $H$, [\ ], lstick($|v_1〉$), $H$, targ(), $H$ ) } The gates #{ import "@preview/quill:0.4.0": * quantum-circuit( lstick($$), $H$, rstick($$), [\ ], lstick($$), $H$, rstick($$) ) } correspond to the following matrice: $1/2 mat(H, H; H, -H;)$ And CNOT = $mat(1, 0, 0, 0; 0, 1, 0, 0; 0, 0, 0, 1; 0, 0, 1, 0;)$ The circuit then corresponds to the following operation: $A&=1/2 mat(1, 1, 1, 1; 1, -1, 1, -1; 1, 1, -1, -1; 1, -1, -1, 1) mat(1, 0, 0, 0; 0, 1, 0, 0; 0, 0, 0, 1; 0, 0, 1, 0;) 1/2 mat(1, 1, 1, 1; 1, -1, 1, -1; 1, 1, -1, -1; 1, -1, -1, 1) \ &=1/4 mat(4, 0, 0, 0; 0, 0, 0, 4; 0, 0, 4, 0; 0, 4, 0, 0) \ &=mat(1, 0, 0, 0; 0, 0, 0, 1; 0, 0, 1, 0; 0, 1, 0, 0)$ Which gives $cases( |00〉 => |00〉, |01〉 => |11〉, |10〉 => |10〉, |11〉 => |01〉 )$ that corresponds to an *inversed CNOT* that we can denote: #{ import "@preview/quill:0.4.0": * quantum-circuit( lstick($|v_0〉$), targ(), rstick($$), [\ ], lstick($|v_1〉$), ctrl(-1), rstick($$) ) } == Q2 In the *classical case*, we need $2^(n-1)+1$ queries to determine if $f$ is constant. Using only $2^n$ queries, all queries could have the same value with $f$ balanced. In the *quantum version*, we may use the following circuit: #{ import "@preview/quill:0.4.0": * quantum-circuit( lstick($|0〉$), $H$, mqgate($U_f$, n:4), $H$, meter(), setwire(2), rstick($$), [\ ], lstick($|0〉$), $H$, targ(), $H$, meter(), setwire(2), rstick($$), [\ ], lstick($...$), [\ ], lstick($|1〉$), $H$, targ() ) }