Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid Schrodinger Feynman Simulator reports error for circuits with SWAP gates #269

Closed
tyi1025 opened this issue Jul 24, 2023 · 1 comment · Fixed by #431
Closed

Hybrid Schrodinger Feynman Simulator reports error for circuits with SWAP gates #269

tyi1025 opened this issue Jul 24, 2023 · 1 comment · Fixed by #431
Assignees
Labels
bug Something isn't working

Comments

@tyi1025
Copy link

tyi1025 commented Jul 24, 2023

mqt.ddsim version

0.1.dev387+g328fdec

OS

macOS Monterey

Python version

No response

C++ compiler

gcc 13.1.6

Additional environment information

No response

Description

The HybridSchrodingerFeynmanSimulator seems to fail when there is a SWAP gate present. It gives Assertion failed: (targets.size() == 2), function getDD, file Operations.hpp, line 240. The error disappears as long as you remove the SWAP line.

Expected behavior

The simulation results should be returned

How to Reproduce

    qc->x(0);
    qc->swap(0, 1);
    auto hybridSimulator = std::make_unique<HybridSchrodingerFeynmanSimulator<>>(
        std::move(qc), ApproximationInfo{}, 23);
    auto result = hybridSimulator->simulate(1024U);
@tyi1025 tyi1025 added the bug Something isn't working label Jul 24, 2023
@hillmich
Copy link
Contributor

Thank you for creating the issue! From the top of my head, I would guess that the splitting the circuit between two targets is not supported in the decomposition. I'll have a look.

@burgholzer burgholzer linked a pull request Sep 12, 2024 that will close this issue
4 tasks
burgholzer added a commit that referenced this issue Sep 12, 2024
## Description

This PR improves the error management of the HSF and the Path Simulator
and makes them report a little more user-friendly error messages if
certain constructs of a circuit are not supported by the simulators.

Fixes #251 and #269

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants