Does 'Phase Inversion' grow exponentially?

Click For Summary

Discussion Overview

The discussion revolves around the concept of phase inversion in quantum computing, specifically in relation to Gover's Algorithm and the use of Toffoli gates. Participants explore the implications of phase inversion on qubit states, the efficiency of representing states, and the mechanics of applying quantum gates to entangled states.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions whether phase inversion grows exponentially, noting the need to represent all 2^N states for N qubits.
  • Another participant suggests that phase inversion can be achieved in O(n) gates using Toffoli gates and ancilla qubits, describing a method to merge controls efficiently.
  • A participant expresses confusion about how to "save" the phase shift of a specific state after applying Hadamard gates, indicating uncertainty about the resulting state representation.
  • Responses clarify that the circuit inherently causes the phase shift and that the Toffoli gate conditionally toggles qubits rather than negating them, leading to a rearrangement of amplitudes.
  • There is a discussion about how to represent operations on entangled states using tensor products, with a focus on how to apply a single qubit operation to a multi-qubit state.
  • Participants discuss the mathematical representation of operations, including the Kronecker product, to apply gates to entangled states.

Areas of Agreement / Disagreement

Participants express differing views on the implications of phase inversion and the mechanics of applying quantum gates, indicating that the discussion remains unresolved with multiple competing perspectives.

Contextual Notes

Participants highlight the complexity of representing qubit states and the operations applied to them, with some assumptions about the nature of phase shifts and the effects of quantum gates remaining implicit.

Who May Find This Useful

Readers interested in quantum computing, particularly those studying quantum algorithms, gate operations, and the mathematical foundations of quantum mechanics may find this discussion relevant.

Ricardo Belchior
Messages
13
Reaction score
0
Hi!

So I'm studying Gover's Algorithm and I have this doubt:

Does 'Phase inversion gate' grows exponentially? I mean, if I want to signal the one combination that is the answer, I must be able to represent all 2^N states, where N is the number of qubits in the system. How do I do this without representing all states?

Cheers,
RB
 
Physics news on Phys.org
You can do the phase inversion on ##n## qubits in ##O(n)## gates.

For example, suppose we want to negate the amplitude of the ##|1111...111\rangle## state, but not affect any other state's amplitude. In other words, we want to perform the operation "if q1 is ON and q2 is ON and q3 is ON and ... q[n-1] is ON then apply Z to q[n]". A simple way to do this efficiently is to use Toffoli gates ("if A and B are ON then toggle C") and ancilla qubits to gradually merge the conditions. For example, after you've applied the operation "if q1 and q2 then toggle a1", you can replace the q1 and q2 parts of the intended operation with a1. You keep merging controls like that until you're down to some constant-sized operation, then you do that constant-sized operation and uncompute all the Toffolis.

Looks like this:

big-ccz.png


Each Toffoli gate merges two controls into one, reducing the total number of controls by 1. There are n-1 controls, so it takes ~n-1 Toffoli gates to merge them all together. We're scaling linearly with the number of qubits.

On top of this simple construction, we can do tricks that reduce the depth of the circuit from O(n) to O(lg n) or we can do tricks that reduce the number of ancilla qubits from O(n) to O(1) or even 0.
 

Attachments

  • big-ccz.png
    big-ccz.png
    2.7 KB · Views: 581
Thanks for your reply.

But I have a question: How to "save" that, in this case, |11111> have some phase shift?

Lets see:
upload_2017-12-13_19-28-57.png


Am I thinking right? In the end, if you apply hadamard gate you'll get

|psi> = -|0> - |1> - |2> - ... - |2^5> and not

|psi> = |0> + |1> + |2> + ... - |2^5>

What am I doing wrong?

Cheers,
 

Attachments

  • upload_2017-12-13_19-28-57.png
    upload_2017-12-13_19-28-57.png
    3.3 KB · Views: 539
What do you mean by "saving" the phase shift? You don't have to do anything extra to save it, the circuit causes it to happen and that's that. It's not going to magically go away.

You seem to be confused about exactly what is being negated, and how the Toffoli gates affect where that negative sign is. I'm not exactly sure how to explain the right intuition... when you have classical gates mixed with phase gates (e.g. Toffolis and Zs), and removing the Z gates gives you an identity circuit, you just think in terms of which input states are hit by the phase.

You might find the blog post Proxy Phasing and Computed Phasing helpful. You might also find the circuit simulator Quirk useful for tracking where the negative signs are.
 
Thanks. I will read the post for sure.

That's the point. The toffoli negates the qubit but the phase goes with it. Just like in X case:

[0 1; 1 0]' * [a b]' = [b a]' , with a and b as complex numbers.

the numbers exchange with each other, and the phases too.

and if you get:

|psi> = |0> + |1> + |2> + ... - |2^5>

how to you go back to just 5 qubits? There is no combination ...

cheers,
 
The Toffoli gate doesn't negate the qubit, it conditionally toggles the qubit. This permutes which amplitude is assigned to which state. So you can think of it as re-arranging amplitudes without changing any. And what the circuit is doing is re-arranging the amplitudes into a layout where the target amplitude is all off on its own and easy to target without hitting the others, then the circuit undoes the re-arranging so that the amplitudes are back where they started but with the target negated.
 
Thanks again for your patience.

So the amplitude re-arrange that toffoli gate does is this right? :

upload_2017-12-14_10-31-5.png


If I change the phase of amplitude of |1> and apply again the toffoli gate I have:

upload_2017-12-14_10-39-27.png


Then, in the end, we have -|0>. Then I don't understand how do we get back to the input.

Cheers
 

Attachments

  • upload_2017-12-14_10-31-5.png
    upload_2017-12-14_10-31-5.png
    715 bytes · Views: 413
  • upload_2017-12-14_10-32-52.png
    upload_2017-12-14_10-32-52.png
    721 bytes · Views: 549
  • upload_2017-12-14_10-39-27.png
    upload_2017-12-14_10-39-27.png
    731 bytes · Views: 440
What do you mean by "get back to the input"?

Also, that's a NOT gate not a Toffoli gate. Toffoli gates act on 3 qubits, i.e. groups of 8 amplitudes.
 
Thank you for your help. I think I figure it out ... I was looking wrong to the picture that you gave me earlier.

Ok now, how can we describe this single qubit operation with algebra since the qubits are entangled?

upload_2017-12-14_19-15-3.png
I.e how do I apply Z to:
[1 0 0 1]'

Given that Z is one qubit gate and that state can't be represented in single qubits?

Cheers
 

Attachments

  • upload_2017-12-14_14-27-13.png
    upload_2017-12-14_14-27-13.png
    299 bytes · Views: 539
  • upload_2017-12-14_19-15-3.png
    upload_2017-12-14_19-15-3.png
    2.4 KB · Views: 456
  • #10
You use the tensor product to expand the operation so it applies to the whole state, i.e. you multiply the 4d state vector by ##I \otimes Z## (or ##Z \otimes I##; depends which wire you put the Z on). In other words, group the state vector entries into pairs that differ on the target qubit but agree on all the other qubits, and apply the operation within each pair.
 
  • #11
Ok but how I⊗Z look like? It should be a 4x4 matrix right?
 
  • #12
Read the Wikipedia article on the Kronecker product (which is a specific kind of tensor product) and it will explain how to compute the matrix.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 22 ·
Replies
22
Views
5K
Replies
8
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K