# Is there a gate sending $|0\rangle^{\otimes n}$ to a state where some amplitudes are zero?

By preparing $$n$$ qubits in $$|0 \rangle ^{\otimes n}$$ and then passing through the Hadamard gate, one can obtain a system superposition in $$\{0,1 \}^n$$, each state with equal probability.

I’m wondering if it’s possible to prepare the system in a state where some of the states $$|i\rangle$$ have a probability of zero.

And $$i$$ need not be constant in some digit.

Using two qubits as an example: input $$|00 \rangle$$, expecting $$|\psi \rangle = \frac{1}{\sqrt{3}}(|10\rangle +|01\rangle+|00\rangle)$$. Do there exists some gate doing this?

• What do you mean “has probability $0$”? You can choose to apply an arbitrary gate to any qubit that puts it into an unequal superposition. There are a number of questions on this site that address how to do that. Jun 5 at 4:18
• For example, two qubits has zero probability in 00, but then 01, 10 are allowed Jun 5 at 4:20
• you can find a unitary sending any initial state into any final state, if that's what you're asking. Or more precisely put, given any pair of states $|\psi\rangle,|\phi\rangle$, there is some unitary $U$ (actually, infinitely many such $U$) such that $U|\psi\rangle=|\phi\rangle$. See eg quantumcomputing.stackexchange.com/q/15807/55
– glS
Jun 5 at 10:40
• In the general case, there is no single answer on how to create such states efficiently and it is still an ongoing field of research. A related question to your is this one: quantumcomputing.stackexchange.com/questions/15692/… which may provide some insight into why it is not an obvious solution Jun 5 at 11:33
• Possible duplicate of quantumcomputing.stackexchange.com/q/17358/10454 Jun 5 at 17:24

you can check out qiskit textbook,

This is how you do it:

import numpy as np
from qiskit import QuantumCircuit, QuantumRegister, assemble, Aer

q = QuantumRegister(2, name = 'q')
circuit = QuantumCircuit(q)

#Define initial state
initial_state = [1/np.sqrt(3), 1/np.sqrt(3),1/np.sqrt(3),0]
circuit.initialize(initial_state, [0,1])

circuit.decompose().decompose().decompose().decompose().decompose().draw("mpl") 