# Q# code for making any two qubits entangled

Suppose there are two different qubits and both with different superposition states. What is the Q# code for making these two qubits entangled?

• Can you please add the formula of the two qubits? Or an example at least? – M. Al Jumaily Jan 14 at 17:04
• @M.AlJumaily The point of the question is that there can be any two qubits. For example considering the Block sphere, we select two different points representing two qubits with two different superposition states, now we try to make them entangled, I hope the question is now clear. – Coder Jan 14 at 19:14
• So you mean something like $\vert \psi_1 \rangle = \alpha_1 \vert 0 \rangle + \beta_1 \vert 1 \rangle$ and $\vert \psi_2 \rangle = \alpha_2 \vert 0 \rangle + \beta_2 \vert 1 \rangle$? – M. Al Jumaily Jan 14 at 20:15
• If yes, are $\alpha_1$, $\alpha_2$, $\beta_1$, $\beta_2$ known or just some unknown values? – M. Al Jumaily Jan 14 at 20:16
• I'm not sure I quite understand the question, sorry. There isn't a single operation that, given two qubits in arbitrary states, transforms those qubits to an entangled state. On the other hand, the set of two-qubit states that aren't entangled (aka, that are separable) is very small such that with very high probability, a random two-qubit operation will leave your two qubits entangled. – Chris Granade Jan 14 at 20:53