Tensor Products in Quantum Computing, Explained Visually

The tensor product in quantum computing is the operation that combines separate qubit states into one state vector describing the whole system. Give it a state for qubit A and a state for qubit B, and it returns a single list of numbers that describes both together.

It is not the “tensor” of TensorFlow or PyTorch, where a tensor is a multi-dimensional array. Here, the tensor product is an operation, not a data structure. The key ideas, each worked through in full below:

  • The recipe: multiply the whole second vector by each number in the first, then stack the results.
  • Two qubits, four numbers: one amplitude for each outcome: 00, 01, 10 and 11.
  • n qubits, 2โฟ numbers: each added qubit doubles the size of the description, which is not the same as doubling speed.
  • Gates combine the same way: I โŠ— X is one 4ร—4 grid meaning “leave qubit one alone, flip qubit two.”
  • Entanglement has a precise test: a two-qubit state is entangled when it cannot be written as a tensor product, and a two-step ad โˆ’ bc check proves it by hand.
  • It runs as ordinary code: the concrete calculation is the Kronecker product, which NumPy’s np.kron does in one call.

Every example below shows each multiplication in full, and every result has been checked in NumPy. If you met the โŠ— symbol in a multi-qubit explanation and stopped, this page picks up exactly there.

What is the Tensor Product in Quantum Computing?

The whole operation fits in one picture: each number in the first vector takes a turn multiplying the entire second vector. You need only three pieces of notation to follow it.

|0โŸฉ is shorthand for the vector (1, 0), and |1โŸฉ for (0, 1). The symbol โŠ— means “tensor product”, and each number inside a state vector is called an amplitude.

Take two single-qubit vectors written with letters, (p, q) and (r, s). The letters stand for any amplitudes, so these three steps work for every example on this page:

  1. Multiply the whole second vector by p: p ร— (r, s) = (pr, ps). Here pr is shorthand for p ร— r.
  2. Multiply the whole second vector by q: q ร— (r, s) = (qr, qs).
  3. Stack the two results in order: (p, q) โŠ— (r, s) = (pr, ps, qr, qs).

Two numbers in from each qubit, four numbers out: one for every pairing of the two.

When the vectors hold actual numbers, this calculation is called the Kronecker product.

Tensor Product in Quantum Computing

How to Calculate the Tensor Product of Two Qubit States?

Now the recipe meets real qubit states. The four basis states come first because their answers are clean. Then come two superpositions, where the amplitudes stop being only 0 and 1.

Tensor Products of the Four Two-Qubit Basis States: |00โŸฉ, |01โŸฉ, |10โŸฉ, and |11โŸฉ (H3)

One qubit has two basis states, |0โŸฉ and |1โŸฉ, so two qubits have four combinations. Each calculation below runs the same three steps: multiply, multiply, stack.

text

|0โŸฉ โŠ— |0โŸฉ = (1, 0) โŠ— (1, 0)

1 ร— (1, 0) = (1, 0)

0 ร— (1, 0) = (0, 0)

stacked: (1, 0, 0, 0)

|0โŸฉ โŠ— |1โŸฉ = (1, 0) โŠ— (0, 1)

1 ร— (0, 1) = (0, 1)

0 ร— (0, 1) = (0, 0)

stacked: (0, 1, 0, 0)

|1โŸฉ โŠ— |0โŸฉ = (0, 1) โŠ— (1, 0)

0 ร— (1, 0) = (0, 0)

1 ร— (1, 0) = (1, 0)

stacked: (0, 0, 1, 0)

|1โŸฉ โŠ— |1โŸฉ = (0, 1) โŠ— (0, 1)

0 ร— (0, 1) = (0, 0)

1 ร— (0, 1) = (0, 1)

stacked: (0, 0, 0, 1)

Line the four results up and a pattern appears. Each basis state puts a single 1 in a different slot of a four-slot list, and the slots follow binary counting. (|00โŸฉ is shorthand for |0โŸฉ โŠ— |0โŸฉ.)

Two-qubit stateState vectorSlot it fills
|00โŸฉ(1, 0, 0, 0)1st (binary 00 = 0)
|01โŸฉ(0, 1, 0, 0)2nd (binary 01 = 1)
|10โŸฉ(0, 0, 1, 0)3rd (binary 10 = 2)
|11โŸฉ(0, 0, 0, 1)4th (binary 11 = 3)

This is where the operation stops being abstract. A two-qubit state vector is simply a list with one slot per outcome, in the order 00, 01, 10, 11. The amplitude in each slot belongs to that outcome.

How to Calculate the Tensor Product of Two Qubit States

Tensor Product Example: Calculating |+โŸฉ โŠ— |0โŸฉ Step by Step

The state |+โŸฉ = (1/โˆš2, 1/โˆš2), about (0.7071, 0.7071), is the equal superposition a Hadamard gate produces from |0โŸฉ. Pair it with |0โŸฉ = (1, 0) and the recipe does not change; only the numbers get more interesting.

text

|+โŸฉ โŠ— |0โŸฉ = (0.7071, 0.7071) โŠ— (1, 0)

0.7071 ร— (1, 0) = (0.7071, 0)

0.7071 ร— (1, 0) = (0.7071, 0)

stacked: (0.7071, 0, 0.7071, 0)

Read the slots back using the table above. Outcomes 00 and 10 carry 0.7071, while 01 and 11 carry 0. In words: the first qubit is equally likely to be 0 or 1, and the second is definitely 0.

Tensor Product of Two Superposition States: |+โŸฉ โŠ— |+โŸฉ

Now put both qubits in superposition. Every multiplication becomes 0.7071 ร— 0.7071, which is exactly 0.5, because (1/โˆš2) ร— (1/โˆš2) = 1/2.

text

|+โŸฉ โŠ— |+โŸฉ = (0.7071, 0.7071) โŠ— (0.7071, 0.7071)

0.7071 ร— (0.7071, 0.7071) = (0.5, 0.5)

0.7071 ร— (0.7071, 0.7071) = (0.5, 0.5)

stacked: (0.5, 0.5, 0.5, 0.5)

All four outcomes, 00, 01, 10 and 11, get the same amplitude, so all four are equally likely.

One step trips up more beginners than the tensor product itself: 0.5 is an amplitude, not a probability. For the real-number amplitudes on this page, square the amplitude to get the probability: 0.5 ร— 0.5 = 0.25, a 25% chance per outcome, and the four add up to 1.

The same rule explains the previous example. There, 0.7071 ร— 0.7071 = 0.5, a 50% chance each for 00 and 10.

Why n Qubits Require 2โฟ Amplitudes in the Quantum State Vector?

The length of the result falls straight out of the arithmetic above. A 2-number vector combined with a 2-number vector gave 2 ร— 2 = 4 numbers, so adding a third qubit gives 4 ร— 2 = 8.

To see it happen, take |0โŸฉ โŠ— |1โŸฉ = (0, 1, 0, 0) from earlier and combine it with one more |1โŸฉ = (0, 1). The recipe now runs four times, once for each number in the first vector.

text

|0โŸฉ โŠ— |1โŸฉ โŠ— |1โŸฉ = (0, 1, 0, 0) โŠ— (0, 1)

0 ร— (0, 1) = (0, 0)

1 ร— (0, 1) = (0, 1)

0 ร— (0, 1) = (0, 0)

0 ร— (0, 1) = (0, 0)

stacked: (0, 0, 0, 1, 0, 0, 0, 0)

The result is an 8-number vector with a single 1 in the fourth slot. Binary counting predicts exactly that: 011 in binary is 3, and counting from zero, slot 3 is the fourth one.

Every qubit you add multiplies the length by 2, so n qubits need 2โฟ amplitudes. The table shows how quickly that grows.

Qubits (n)Numbers needed (2โฟ)
12
24
38
416
532
664
7128
8256
9512
101,024
201,048,576
301,073,741,824
501,125,899,906,842,624

Twenty qubits already need about a million numbers, and thirty about a billion. At 50 qubits, just writing the state down on a classical computer takes over a thousand trillion numbers.

That figure measures the size of the description: how many numbers it takes to write a state down.

It is not a speed claim. Measuring 50 qubits returns one 50-bit result, not a thousand trillion numbers, and quantum speed-ups come only from algorithms designed for specific problems.

number of amplitudes needed vs number of qubits

Tensor Products of Quantum Gates: How Multiple Qubit Operations Combine

The same operation applies to gates, which are written as 2ร—2 grids of numbers. The tensor product of two gates is one 4ร—4 grid that says “do this to qubit one and that to qubit two” in a single step.

The recipe barely changes: each number in the first grid multiplies the entire second grid, and each block lands where its number sat.

Example: I โŠ— X Tensor Product : Identity on One Qubit and X Gate on the Other

I is the identity gate, which changes nothing: [[1, 0], [0, 1]]. X is the bit-flip gate: [[0, 1], [1, 0]]. Each number in I multiplies the whole of X:

text

top-left: 1 ร— X = [[0, 1], [1, 0]]

top-right: 0 ร— X = [[0, 0], [0, 0]]

bottom-left: 0 ร— X = [[0, 0], [0, 0]]

bottom-right: 1 ร— X = [[0, 1], [1, 0]]

Assembled, I โŠ— X is two X blocks along the diagonal. Columns are the input state and rows are the output state:

text

I โŠ— X in: 00 01 10 11

out 00: [ 0 1 0 0 ]

out 01: [ 1 0 0 0 ]

out 10: [ 0 0 0 1 ]

out 11: [ 0 0 1 0 ]

When the input is a basis state, the output is simply that input’s column. Column 10 has its 1 in row 11, so |10โŸฉ becomes |11โŸฉ: qubit one stays 1 and qubit two flips. Every column follows the same pattern.

Example: H โŠ— H Tensor Product : Applying Hadamard Gates to Two Qubits

The Hadamard gate is H = 0.7071 ร— [[1, 1], [1, โˆ’1]], so its four numbers are 0.7071, 0.7071, 0.7071 and โˆ’0.7071. Each one multiplies the whole of H, and every product of two 0.7071s is ยฑ0.5:

text

top-left: 0.7071 ร— H = [[0.5, 0.5], [0.5, โˆ’0.5]]

top-right: 0.7071 ร— H = [[0.5, 0.5], [0.5, โˆ’0.5]]

bottom-left: 0.7071 ร— H = [[0.5, 0.5], [0.5, โˆ’0.5]]

bottom-right: โˆ’0.7071 ร— H = [[โˆ’0.5, โˆ’0.5], [โˆ’0.5, 0.5]]

Assembled, with the same row and column labels as before:

text

H โŠ— H in: 00 01 10 11

out 00: [ 0.5 0.5 0.5 0.5 ]

out 01: [ 0.5 โˆ’0.5 0.5 โˆ’0.5 ]

out 10: [ 0.5 0.5 โˆ’0.5 โˆ’0.5 ]

out 11: [ 0.5 โˆ’0.5 โˆ’0.5 0.5 ]

Apply it to |00โŸฉ by reading the 00 column: (0.5, 0.5, 0.5, 0.5). That is exactly |+โŸฉ โŠ— |+โŸฉ from earlier.

Two routes, same answer: turn each qubit into |+โŸฉ and combine the states, or combine the gates and apply H โŠ— H to |00โŸฉ. That consistency is why the tensor product is the right tool for more than one qubit.

Product States vs Entangled States: How the Tensor Product Reveals Entanglement?

A two-qubit state is entangled exactly when it cannot be written as a tensor product of two single-qubit states. A state that can be written that way is a product state, also called separable.

Nothing in that definition mentions distance or connection; it is a statement about arithmetic. Entanglement is what is left over where the tensor product cannot reach.

Telling the two apart takes only multiplication and subtraction. Write any two-qubit state’s amplitudes in order as (a, b, c, d), then:

  1. Fold them into a 2ร—2 grid: top row [a, b] for outcomes 00 and 01, bottom row [c, d] for 10 and 11.
  2. Multiply along each diagonal and subtract: ad โˆ’ bc.
  3. If ad โˆ’ bc = 0, the state is a product state and can be split. If not, it is entangled.

The test comes straight from the recipe. Any product state has the form (p, q) โŠ— (r, s) = (pr, ps, qr, qs), so a = pr, b = ps, c = qr and d = qs:

text

ad โˆ’ bc = (pr ร— qs) โˆ’ (ps ร— qr)

= pqrs โˆ’ pqrs

= 0

So every product state scores zero. The reverse also holds: any state that scores zero can be split into two single-qubit states.

Test 1: |+โŸฉ โŠ— |0โŸฉ = (0.7071, 0, 0.7071, 0)

This is the state built earlier with a tensor product, so it should pass. Here are its grid and the two diagonal products:

text

grid: [ 0.7071 0 ]

[ 0.7071 0 ]

ad = 0.7071 ร— 0 = 0

bc = 0 ร— 0.7071 = 0

ad โˆ’ bc = 0 โˆ’ 0 = 0

Zero, so it is a product state, as it must be.

Test 2: the Bell state (0.7071, 0, 0, 0.7071)

This state gives 0.7071 to outcomes 00 and 11 and nothing to 01 or 10. It comes from a Hadamard gate on the first qubit followed by a CNOT, both covered in our quantum gates guide.

text

grid: [ 0.7071 0 ]

[ 0 0.7071 ]

ad = 0.7071 ร— 0.7071 = 0.5

bc = 0 ร— 0 = 0

ad โˆ’ bc = 0.5 โˆ’ 0 = 0.5

Not zero, so no pair of single-qubit states multiplies out to this vector. The Bell state is entangled, and one multiplication and one subtraction prove it.

Side by side with the all-0.5 state from earlier, the three results show exactly where the line falls.

Statead โˆ’ bcVerdict
|+โŸฉ โŠ— |0โŸฉ = (0.7071, 0, 0.7071, 0)0Product state: can be split
|+โŸฉ โŠ— |+โŸฉ = (0.5, 0.5, 0.5, 0.5)0.25 โˆ’ 0.25 = 0Product state: can be split
Bell state (0.7071, 0, 0, 0.7071)0.5Entangled: cannot be split

|+โŸฉ โŠ— |+โŸฉ passes even though every amplitude is non-zero. The test checks how the amplitudes relate to each other, not how many of them are zero.

Product State vs Entangled State: The ad โˆ’ bc Separability Test

the separability test as a picture

The tensor product is the first piece of a much longer mathematical toolkit. If you would rather work through it in order, with someone to ask, the Certification in Applied Quantum Computing and AI from IIT Delhi runs over 6.5 months, live online with recorded sessions.

Frequently Asked Questions

Does the order of qubits matter in a tensor product?

Yes. In general, (|0\rangle \otimes |1\rangle) and (|1\rangle \otimes |0\rangle) describe different ordered systems. The position of each qubit determines which binary outcomes correspond to each amplitude.

Can you take the tensor product of a qubit and a multi-qubit state?

Yes. A single-qubit state can be combined with a state containing two or more qubits. The resulting vector gets twice as many amplitudes whenever one additional qubit is added.

Does a tensor product mean that two qubits are interacting?

No. A tensor product describes how separate quantum states are represented together as one composite state. Interaction requires an operation such as a quantum gate that acts across the qubits.

Why does the size of a quantum state vector grow so quickly?

Each additional qubit introduces another binary possibility for every existing outcome. This causes the number of amplitudes to multiply by two repeatedly rather than increase by a fixed amount.

Can a tensor product describe the state of more than two qubits?

Yes. Tensor products can be applied repeatedly to combine three, four, or many qubits into a single state vector. The same operation is extended one qubit at a time.

What determines the position of an amplitude in a multi-qubit state vector?

The position follows the binary label of the corresponding computational-basis state. For example, the binary pattern associated with an outcome determines which slot represents its amplitude.

Can every two-qubit state be written as a tensor product of two qubits?

No. Some two-qubit states cannot be decomposed into two independent single-qubit states. These are the states identified as entangled rather than separable.

Can two different tensor-product expressions represent the same quantum state?

They can describe the same physical state when they differ only by an overall global phase. The numerical vectors may therefore look different while representing the same quantum state for measurement purposes.

Why are tensor products also used for quantum gates?

A gate acting on several qubits must be represented by an operator whose dimensions match the combined state space. Tensor products provide a systematic way to build that larger operator from gates acting on individual qubits.

How does a tensor product relate to a quantum circuit?

A circuit describes operations performed on qubits, while tensor products provide the mathematical representation of the combined states and multi-qubit operations. They work together to describe how a circuit acts on a complete quantum system.

IIT Delhi

Continuing Education Programme

Certification in Applied Quantum Computing and AI

One of India's first applied quantum programmes โ€” built for the quantum decade.

Duration

6.5 Months

Format

Live Online + Recorded

Batch

Weekend

Application open now

6.5 Months

Weekend batch

4+1 Projects

Incl. capstone

STEM Eligible

B.Tech / BE / BSc

Varsity

ร—

Quantum Computing