TransWikia.com

How to add scalar to quantum string

Quantum Computing Asked on September 5, 2021

I need a way to add scalar values to a quantum string.

Say if
$| v rangle = |1 1 0 rangle + |1 0 1 rangle$ then $|v rangle + 5 = |1 0 1 1 rangle + |1 1 0 0rangle$

Is there a known method to do this?

I don’t want tot express 5 as a qubit string in order to save qubits.

3 Answers

Generally you have to perform the addition modulo some constant; you can't grab another qubit if you need to overflow. Code for modular addition of a constant is available in the Increment.qs file in the Q# standard library, in the IncrementByInteger operation. Check out the documentation here.

Correct answer by Alan Geller on September 5, 2021

I don't know the answer to this question but I will try to put my thoughts. Why do you want to add a number to a state? A state is unknown untill it is measured. and in your equation the sum of squares of probabilities is 2, how could that be possible.

A classical 5 means 101 which means presence, absence, presence of electrons(not electron or photon). Another doubt I got is, we use classical gates to add scalars and quantum gates for quantum operations, how can we do both in one equation.

May be unless we measure the state we cannot add 5.

Answered by Rishwi binnu on September 5, 2021

There are definitely ways to do this; the first one I could find is described in this paper by Thomas Draper (page 6).

Answered by Mariia Mykhailova on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP