# Circuit simulation on 'ibmq\_qasm\_simulator' taking a lot of time

**URL:** <https://discuss.pennylane.ai/t/circuit-simulation-on-ibmq-qasm-simulator-taking-a-lot-of-time/3271>\
**Category:** PennyLane Qiskit\
**Created:** [August 2, 2023, 6:10pm UTC](https://discuss.pennylane.ai/t/circuit-simulation-on-ibmq-qasm-simulator-taking-a-lot-of-time/3271 "2023-08-02T18:10:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ludmilaaasb](https://avatars.discourse-cdn.com/v4/letter/l/d78d45/32.png) [@ludmilaaasb](https://discuss.pennylane.ai/u/ludmilaaasb)\
**Post date:** [August 2, 2023, 8:36pm UTC](https://discuss.pennylane.ai/t/circuit-simulation-on-ibmq-qasm-simulator-taking-a-lot-of-time/3271/2 "2023-08-02T20:36:33Z")

</div>

Hello @imakash !

As I mentioned in this [post reply](https://discuss.pennylane.ai/t/parameter-broadcasting-problem-with-torch-node/3269/7), I would suggest first updating your PennyLane installed version.

I also did some minor modifications to the code you shared:

```auto
import pennylane as qml
from pennylane import numpy as np
import time as time
import torch
import torch.nn as nn

dev = qml.device("default.qubit", wires=1)
@qml.qnode(dev, interface = 'torch')
def simple_qubit_circuit(inputs, theta):
    qml.RX(inputs, wires=0)
    qml.RY(theta, wires=0)
    return qml.expval(qml.PauliZ(0))
class QNet(nn.Module):
    def __init__ (self):
        super(). __init__ ()
        shapes = {
            "theta": ()
        }
        self.q = qml.qnn.TorchLayer(simple_qubit_circuit, shapes)
    
    def forward(self, input_value):
        return self.q(input_value)

x_train = np.array([0.2, 0.1, 0.2, 0.14, 0.11, 0.41, 0.55, 0.3, 0.31, 0.6])
x_train = torch.tensor(x_train)

model = QNet()
t1 = time.time()
out = model(x_train)
print("time taken for batch operations: {} seconds".format(time.time()-t1))

```

and I got:

```auto
time taken for batch operations: 0.005563020706176758 seconds

```

The time seems reasonable to me.

Does it help? 🙂

---

_[View the full topic](https://discuss.pennylane.ai/t/circuit-simulation-on-ibmq-qasm-simulator-taking-a-lot-of-time/3271)._
