Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

0 votes

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

I don't know how to do it without ancillary registers, but here's a version with two extra registers. It uses one extra register to temporarily compute the multiplicative inverse, and the other to do ...
Craig Gidney's user avatar
  • 37.8k
1 vote
Accepted

What is the "equivalent" quantum computational complexity class of the classical class APX (or PTAS)?

Marked CW because I'm probably speaking with improper authority. The classes FPTAS, PTAS, and APX are defined with respect to a classical polynomial-time algorithm to give the appropriate ...
2 votes

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

I have modified a quantum-quantum multiplication operator to do what you're looking for. ...
BeriPhysics's user avatar
1 vote

What is the point of building arithmetic circuits in a quantum computer?

Generally speaking, you're right that you want to do as much of the arithmetic as you can on classical computers. But in a quantum algorithm, many of the values you need to do arithmetic to will be ...
Craig Gidney's user avatar
  • 37.8k
2 votes

What is the point of building arithmetic circuits in a quantum computer?

Yes, it is practical! For Grover algorithm - check the following example For risk analysis in finance - once you want to prepare some variables representing some payoff in the market. Check those ...
Ron Cohen's user avatar
  • 1,432
2 votes

Does subtraction circuit have a class like full or half Carry adder circuit in qiskit? one subtraction circuit code-example in qiskit?

For subtraction as mentioned earlier you have to negate the number, and than use an adder. There are few possible implementations for that (adder can be with QFT or with ripple-carry adder with more ...
Ron Cohen's user avatar
  • 1,432
2 votes

How to prepare an initial state for variational quantum algorithms?

State preparation in general is a common task for beginning quantum algorithms. Most generically, you can prepare your state with Classiq like this. Classiq Function Library in Github ...
Amir Naveh's user avatar
0 votes

Pauli Strings on the same qubit?

To get a sparse pauli operator for $X \times Y = iZ$ you can use complex coeffecients. Here is how you can do this: ...
Shravan Patel's user avatar
1 vote

How to convert a combinatorial optimization problem into a problem hamiltonian

You can convert pyomo (an open-source Python library for defining and solving classical optimization problems) problems to Hamiltonian problems using Classiq. Check this user guide to see how to do it....
Ron Cohen's user avatar
  • 1,432
5 votes

What's the cost of finding $(x,y)$ such that $g(f(x),y)=1$ via Grover?

In this work Estimating quantum speedups for lattice sieves: https://eprint.iacr.org/2019/1161.pdf, in section 3 they define the notion of a `filtered quantum search'. I think you should be able to ...
Aditya Morolia's user avatar
0 votes
Accepted

How to convert a combinatorial optimization problem into a problem hamiltonian

Qiskit Optimization has a QuadraticProgram object that can read_from_lp_file and can then be converted to_ising Hamiltonian. This LP file reading does need CPLEX installed, as the docs note, but if ...
Steve Wood's user avatar
  • 1,488
2 votes

How to convert a combinatorial optimization problem into a problem hamiltonian

This video tutorial is a very good starting point to the subject. Then you can go through the paper "Ising formulations of many NP problems" by Lucas for more advanced mappings.
Egretta.Thula's user avatar
0 votes

Does Qiskit SamplerV2 change circuit depth?

Try sampler.options.twirling.enable_measure = False. Make sure that you've installed the latest qiskit-ibm-runtime.
Yael Ben-Haim's user avatar
0 votes
Accepted

How to correctly compute expectation value in QAOA?

My mistake is that I compute $x^T H_c x$ instead of $xh + x^T J x$, since if I put $h$ terms on the diagonal of $H_c$, all coefficients of $h_i$ would be equal to one regardless of $x_i=1$ or $x_i=-1$,...
Oleksii's user avatar
  • 21
0 votes

How to draw a balanced function for three-bit input?

Consider the third qubit being the output. The circuit below implements a balanced function $f: q_1q_2q_3 \mapsto q_3$. $$f(000) = f(001) = f(011) = f(100) = 0$$ $$f(010) = f(101) = f(110) = f(111) = ...
Daniele Cuomo's user avatar
2 votes

Simulating any fixed time classical circuit in time poly(t) on a quantum computer

In talking to some professors I found the answer myself. The statement does indeed hold (and is probably proven using the universality of the Toffili gate). The reason I was confused with the binary ...
Thyrum's user avatar
  • 61
1 vote
Accepted

List of references for quantum algorithms for optimization problems

In this talk, Ronald de Wolf surveys quantum speed-ups for both discrete and continuous optimization. And here is the slide deck.
Egretta.Thula's user avatar
2 votes

Why does the QFT provide for so many controlled rotations?

I suggest reading the book QIQC by Nielsen and Chuang. An entire chapter explains how to build a QFT circuit and why the rotation gates are needed. In short, the main idea is to build a circuit that ...
MonteNero's user avatar
  • 2,656
1 vote

What's the result of applying a CNOT gate followed by a Hadamard?

Your calculations are correct. Make the following three observations: $|\psi\rangle=|{++}\rangle$, $X|+\rangle=|+\rangle$, so $\text{CNOT}|{++}\rangle=|{++}\rangle$, $H|{+}\rangle=|0\rangle$. ...
Adam Zalcman's user avatar
  • 22.9k
1 vote

What's the result of applying a CNOT gate followed by a Hadamard?

Your formuals are correct 💯 It is also makes sense as if you would apply the reverse order on the output, you will get the input mentioned
Ron Cohen's user avatar
  • 1,432
2 votes

How to perform amplitude amplification to return $|\psi_{\rm good}⟩$ from $\cos\theta|\psi_{\rm good},\phi⟩+\sin\theta|\psi_{\rm bad},\phi^\perp⟩$?

For question 1 - A state is a valid quantum state if it is normalised (i.e. the sum of the absolute value of its coefficients squared add to 1). For question 2 - This question is basically asking you ...
sheesymcdeezy's user avatar
7 votes
Accepted

How to read the result of quantum shor circuit for N=15

The circuit you reference has a control register that is only three qubits long, which is fine as an example, but insufficient if you are to guarantee being able to solve via continued fractions as ...
Martin Ekerå's user avatar
1 vote
Accepted

What is the promise gap in APPROX-CIRCUIT-VALUE (BQP-complete) problem?

For clear estimation problems such as GLHE or diagonal entries of matrix powers, the goal is to estimate a value up to some additive (or multiplicative) error. But often to prove complexity results ...
Mark Spinelli's user avatar

Top 50 recent answers are included