1
$\begingroup$

I would like to create a n-dimensional Hadamard transform in Q# with n in set of even integers.

$\endgroup$
0
3
$\begingroup$

If you're looking to implement $H^\otimes$ (i.e., applying the Hadamard transform to each of the $n$ qubits), you can use library operation ApplyToEach:

using (register = Qubit[n]) {
    ApplyToEach(H, register);
}

If you are indeed looking for quantum Fourier transform, as the other answer suggests, the Q# library operation that implements it is ApplyQuantumFourierTransform.

$\endgroup$
2
  • $\begingroup$ thank you! if I have a register like |000>, |111> I would need to use quantum fourier transform? $\endgroup$
    – Mridul
    Jun 26 '20 at 2:16
  • 1
    $\begingroup$ That really depends on what you want to do with it. Quantum Fourier transform will prepare a superposition of basis states with complex amplitudes, applying an H gate - a superposition of basis states with amplitudes +1 and -1, depending on the input state. $\endgroup$ Jun 26 '20 at 3:33
1
$\begingroup$

The higher order analog of Hadamard Transform is the Quantum Fourier Transform. You can learn more about it on Wikipedia.

$\endgroup$
1
  • 1
    $\begingroup$ I would rather said that Hadamard $n$ dimensional transform is equivalent to application of QFT on state $|0\rangle ^ {\otimes n}$. $\endgroup$ Jun 26 '20 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.