# Qiskit aer simulation with torch interface

**URL:** <https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112>\
**Category:** PennyLane Help\
**Created:** [August 22, 2022, 7:02pm UTC](https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112 "2022-08-22T19:02:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjvarma](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/tjvarma/32/1128_2.png) [@tjvarma](https://discuss.pennylane.ai/u/tjvarma)\
**Post date:** [August 22, 2022, 7:02pm UTC](https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112/1 "2022-08-22T19:02:12Z")

</div>

It appears that when running the following code from “How to simulate noise with PennyLane”:

```auto
import qiskit
import qiskit.providers.aer.noise as noise
import pennylane as qml

p = 0.01
my_bitflip = noise.pauli_error([('X', p), ('I', 1 - p)])

my_noise_model = noise.NoiseModel()

my_noise_model.add_quantum_error(my_bitflip, ['h'], [0])

dev4 = qml.device('qiskit.aer', wires=1, noise_model = my_noise_model)

@qml.qnode(dev4)
def bitflip_circuit_aer():
    qml.Hadamard(0)
    return qml.expval(qml.PauliZ(0))

print(bitflip_circuit_aer())

```

And then changing the 14th line from `@qml.qnode(dev4)` to `@qml.qnode(dev4, interface='torch')` I get a SIGSEGV segmentation violation.

Is there a way of running a qiskit noisy device using the torch interface in pennylane?

---

<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:** [August 23, 2022, 9:19pm UTC](https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112/2 "2022-08-23T21:19:56Z")

</div>

Hi @tjvarma, welcome to the forum!

I’m running this on Xanadu Cloud and it runs properly. Can you please post the output of `qml.about()`?

---

<div class="post-metadata">

**Author:** ![tjvarma](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/tjvarma/32/1128_2.png) [@tjvarma](https://discuss.pennylane.ai/u/tjvarma)\
**Post date:** [August 30, 2022, 2:47pm UTC](https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112/3 "2022-08-30T14:47:03Z")

</div>

Hi @CatalinaAlbornoz, thank you for getting back to me.

This is the output of qml.about():

```auto
Name: PennyLane
Version: 0.25.1
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: anaconda3/envs/qmsc/lib/python3.10/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, retworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning, PennyLane-qiskit

Platform info: macOS-10.16-x86_64-i386-64bit
Python version: 3.10.4
Numpy version: 1.23.2
Scipy version: 1.9.1
Installed devices:
- default.gaussian (PennyLane-0.25.1)
- default.mixed (PennyLane-0.25.1)
- default.qubit (PennyLane-0.25.1)
- default.qubit.autograd (PennyLane-0.25.1)
- default.qubit.jax (PennyLane-0.25.1)
- default.qubit.tf (PennyLane-0.25.1)
- default.qubit.torch (PennyLane-0.25.1)
- default.qutrit (PennyLane-0.25.1)
- lightning.qubit (PennyLane-Lightning-0.25.1)
- qiskit.aer (PennyLane-qiskit-0.24.0)
- qiskit.basicaer (PennyLane-qiskit-0.24.0)
- qiskit.ibmq (PennyLane-qiskit-0.24.0)
- qiskit.ibmq.circuit_runner (PennyLane-qiskit-0.24.0)
- qiskit.ibmq.sampler (PennyLane-qiskit-0.24.0)
None

```

Maybe for additional context, I’m running this on a conda virtual environment with only: “torch”, “pennylane”, “qiskit”, and “pennylane-qiskit” installed and I’m getting the following error:

```auto
OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

```

Thank you in advance for your help

---

<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:** [August 30, 2022, 11:21pm UTC](https://discuss.pennylane.ai/t/qiskit-aer-simulation-with-torch-interface/2112/4 "2022-08-30T23:21:40Z")

</div>

Hi @tjvarma, I’m still unable to reproduce your problem. I have found this [GitHub issue](https://github.com/dmlc/xgboost/issues/1715) from another repo, where other people have posted some possible solutions. Please let me know if one of the solutions there works for you.
