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

Bug report: recursive_qs_search #42

Open
renezander90 opened this issue Apr 4, 2024 · 0 comments
Open

Bug report: recursive_qs_search #42

renezander90 opened this issue Apr 4, 2024 · 0 comments

Comments

@renezander90
Copy link
Contributor

A error occurs when recursive_qs_search is applied to a network.Graph.

from qrisp import *
import networkx as nx

def test(G, qv):
    h(qv)
    
qv = QuantumVariable(1)
G = nx.Graph()
G.add_edges_from([(0, 1), (0, 2)])

with conjugate(test)(G, qv):
    h(qv)

Here, the conjugation environment applies recursive_qs_search to the arguments G, qv.
If G is a networkx.Graph this yields an error.

A workaround would be hiding the graph G:

from qrisp import *
import networkx as nx

def test_workaround(G, qv):
    def test(qv):
        h(qv)
    return test     
    
qv = QuantumVariable(1)
G = nx.Graph()
G.add_edges_from([(0, 1), (0, 2)])

test = test_workaround(G, qv)

with conjugate(test)(qv):
    h(qv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant