# Two Qnodes Chained

**URL:** <https://discuss.pennylane.ai/t/two-qnodes-chained/2501>\
**Category:** PennyLane Help\
**Created:** [February 4, 2023, 5:03pm UTC](https://discuss.pennylane.ai/t/two-qnodes-chained/2501 "2023-02-04T17:03:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Kashif](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/muhammad_kashif/32/558_2.png) [@Muhammad\_Kashif](https://discuss.pennylane.ai/u/Muhammad_Kashif)\
**Post date:** [February 4, 2023, 5:03pm UTC](https://discuss.pennylane.ai/t/two-qnodes-chained/2501/1 "2023-02-04T17:03:44Z")

</div>

Hi,

Two questions:

1. If I have two chained `Qnodes` (both using the same device) where output of first is fed as an input of second, and both contains an `n-qubit` circuit. if `n` is same in both Qnodes, then am I utilizing `2n` qubits or `n` qubits.

2. while using the lightning.qubit device, I am unable to go beyond 21 qubits, is there any limit to use the number of qubits?

Thanks in anticipation.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [February 8, 2023, 10:10pm UTC](https://discuss.pennylane.ai/t/two-qnodes-chained/2501/2 "2023-02-08T22:10:38Z")

</div>

Hi @Muhammad_Kashif,

Regarding your first question, because they are different qnodes then think of using a same device for executing different circuits. If the device is set with ‘n’ wires then you are using ‘n’ qubits. You’re just using the device twice, but each time with ‘n’ qubits 😃

Regarding your second question, there’s no hard limit on the number of qubits you can use. The limit is usually on the capacity of your computer. Usually after 20 qubits you start running out of memory on a laptop.

I hope this helps!
