Share Your Experience: Take the 2024 Developer Survey

# Questions tagged [arithmetic]

The tag has no usage guidance.

13 questions
Filter by
Sorted by
Tagged with
1 vote
19 views

### Highly-efficient $n(n+1)$?

Appendix G of this paper provides a highly-efficient way of squaring integer numbers. (LMK if anything more advanced is already available.) I'm wondering if this approach can be easily modified to ...
• 1,951
1 vote
93 views

### How can I initialize a classic register in qiskit?

is there a way to initialize a classic register in qiskit? I will go quickly through my problem and then suggest one solution but I am not satisfied with that and ask if there is another solution. ...
• 191
42 views

### On unitary matrix form suggested in the Elementary gates paper

In the Elementary gates for quantum computation paper by Barenco et al authors start their proofs by defining a generic form of 2x2 unitary matrix of $\mathbb{C}$ as follows: Can you help me with the ...
• 133
50 views

### Qiskit: RGQFTMultiplier is giving wrong answers for 28 bits number multiplication with MPS simulator

I am using RGQFTMultiplier for multiplying two unsigned integers. Starting from simpler example of 2 qbits input, I reached 24 and all worked fine. I am using MPS as backend and my RAM is 32. However ...
• 233
44 views

### Comparing qubit values in pairs of qubits

For $2N$ qubits $\{i_1,j_1\ldots i_N,j_N\}$ I would like to have a circuit changing the value of an ancillary register from $0$ to $1$ if $i_1=j_1$ AND $i_2=j_2$ AND ... AND $i_N=j_N$. One way to ...
• 1,951
1 vote
140 views

### Problem adding two numbers in a quantum computer with Drapper's algorithm

I would like to add numbers. In this simple example a = 1 and b = 1. The circuit I created looks like this: We have two registers a and b. Both have a size of 3 qubits. I'm using Big Endian notation, ...
• 57
208 views

### Why a Fourier Adder Gives Multiple Faulty Results?

I followed this tutorial and wrote a code that implements the following circuit: By writing the following code: ...
266 views

### Is it possible to implement an in-place multiplication quantum circuit?

How can a reversible multiplication quantum circuit be implemented? By "reversible" I mean one that performs a *= b on the inputs a and b of the ...
• 51
138 views

Assume one is given two oracle circuits providing access to matrices $A_{ij}$ and $B_{ij}$ as follows (see eq. (6.2) here): O_A |0\rangle|i\rangle|j\rangle=\left(A_{ij}|0\rangle+\sqrt{...
• 1,951
62 views

### How can one sort two registers without leaving an entangled ancilla behind used for comparison?

If we have an state $\alpha|abc\rangle + \beta|bad\rangle$, and we know that $a<b$, how can we obtain state $\alpha|abc\rangle + \beta|abd\rangle$ without entangled ancillas, if we don't know $c$ ...
• 511
103 views

### How to verify a matrix-vector product with Grover search?

I am looking at the Ambainis et al. method of verifying whether $AB = C$ in $O(n^{7/4})$ queries, as described in Buhrman and Špalek. They have the following sentence: verify the matrix-vector ...
• 135
96 views

### Formulate Controlled-Not as mapping (including modulo-2 addition)

We often see that the controlled-not gate is written as $CNOT |x y \rangle = |x\rangle |x \oplus y\rangle$. Now, would it be possible to further expand this to get a general equation? (\alpha_0 |0\...
• 35