3
$\begingroup$

Now I'm studying about the quantum circuit in qiskit developed by IBM.

The quantum circuit have a several method in itself like depth() and num_tensor_factor().

I don't know what is different between depth and num_tensor_factor.

Please let me know this.

num_tensor_factors: Computes the number of tensor factors in the unitary (quantum) part of the circuit only

depth: Return circuit depth (i.e., length of circuit path)

$\endgroup$

1 Answer 1

1
$\begingroup$
  1. The depth of a circuit is the longest path in the circuit. Which is an integer number, representing the number of gates it has to execute in that path. For more details, see this question: What's meant by the depth of a quantum circuit?

  2. As stated in the qiskit documentation, the num_tensor_factors computes the number of tensor factors in the unitary (quantum) part of the circuit only. So given a circuit $U$, it will determine the decomposition of $U$ into tensor products of smaller system $U_i$. In other words, we are rewriting $U$ as $U = U_1 \otimes U_2 \otimes \cdots \otimes U_i \cdots U_k $. The number $k$ is essentially the num_tensor_factors you are looking for. Note that this number is always less or equal to the number of of qubits in the system. That is, if you have $n$ qubits system, then the num_tensor_factors $\leq n$. If the num_tensor_factors $=n$ then that means all the qubits in your circuit are separated and not interacting with each other at all. Essentially, your circuit only contains single qubit gates. On the other hand, if num_tensor_factors $=1$ then that means there is at least one two-qubit gates acting on each of the qubit at some part in the circuit.

Example 1: This 3-qubit quantum circuit has num_tensor_factors $= 3$

enter image description here

Not there are no two-qubit gates. You can essentially write the circuit as $U = H \otimes H \otimes H$. So the circuit $U$ can be decomposed as a tensor of product of $U_1, U_2, U_3 $ where each of them equal to the Hadamard gate $H$.

Example 2: This 3-qubit quantum circuit has num_tensor_factors $= 2$

enter image description here

This is because you can write $U = U_1 \otimes U_2$ where $U_1 = (H \otimes H) \cdot R_{XX} $ and $U_2 = H \cdot S$

Example 3: This 3-qubit quantum circuit has num_tensor_factors $= 1$

enter image description here

can you see why?

$\endgroup$
1
  • $\begingroup$ Okay I understand it. Thank you for your nice answer. $\endgroup$ Mar 12 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.