2
$\begingroup$

I know I must define $U_f$, the unitary operator, on the computational basis. But what's my computational basis here?

$\endgroup$
2
$\begingroup$

First, I would say you need to specify registers, their size, their role and what will they will contain.

It depends on the $i$ you want to apply this function, which is to be represented as a bitstring (in this case, I guess an unsigned integer representation) that will be one of the computational basis. It can be a particular one or just a superposition. You need to define the registers (the one containing $i$, garbage register containing intermediary results and the one containing the result). Mathematically, your operator will have the following effect if you uncompute intermediary results : $$ U_f | i \rangle | 0 \rangle_g | 0 \rangle_f = | i \rangle | 0 \rangle_g | f(i) \rangle_f $$

Secondly, to define this unitary, you need the sequence of unitary operations that will achieve your goal. It is recommended to not create a unitary operator by specifying the matrix.

$\endgroup$
1
$\begingroup$

Presumably you want to work with qubits? So the usual computation basis applies: $|0\rangle$ and $|1\rangle$ for a single qubit, and a composite basis of $|x\rangle$ for $x\in\{0,1\}^n$ when composing $n$ qubits.

What I guess you're asking is how you translate your problem onto qubits. For that, you need to make the decimal values correspond to particular bit values. The conventional way of doing this is using the binary string $x$ like a binary number, which corresponds to a decimal value. There are a number of different numbering conventions you can pick from but, for example, you might have $$ x=x_0x_1x_2\ldots x_{n-1}, $$ meaning that the corresponding decimal value is $$ x_{n-1}+2x_{n-2}+4x_{n-3}+\ldots+2^{n-2}x_1+2^{n-1}x_0. $$ $n$ bits lets you represent any decimal number 0 to $2^n-1$.

$\endgroup$

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.