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

Some troubles in Qiskit version 0.19.1 #1

Open
pearcandy opened this issue Jan 26, 2022 · 1 comment
Open

Some troubles in Qiskit version 0.19.1 #1

pearcandy opened this issue Jan 26, 2022 · 1 comment
Assignees

Comments

@pearcandy
Copy link

I met the following erros when executing tutorial.ipynb in Qiskit 0.19.1.

example2 = pattern.recognition( circuit=circ, level=2, n_patterns=4, min_num_nodes=4, max_num_nodes=8, min_n_repetition=2)

TypeError Traceback (most recent call last)
/tmp/ipykernel_51513/119591637.py in
----> 1 example2 = pattern.recognition( circuit=circ, level=2, n_patterns=4, min_num_nodes=4, max_num_nodes=8, min_n_repetition=2)
:
:
147 for edge in dag.edges(node):
148 child = edge[1]
--> 149 qbit = edge[2]['wire']
150 if child in node_list:
151 G.add_edge(node, child, edge_attr=(str(qbit.index)))

TypeError: 'Qubit' object is not subscriptable

from aqcel.optimization import slim

ImportError Traceback (most recent call last)
/tmp/ipykernel_51513/2067089768.py in
----> 1 from aqcel.optimization import slim
:
:
1 import numpy as np
----> 2 from aqcel.optimization import RIIM_tools
3 from qiskit import *
4 from qiskit.converters import circuit_to_dag, dag_to_circuit
5 from qiskit.dagcircuit import DAGCircuit

ImportError: cannot import name 'RIIM_tools' from 'aqcel.optimization' (../aqcel/optimization/init.py)

I found some bugs and tried to modify the following points.
However, I could not reproduce the results in ./demo/tutorial.ipynb, circuit optimization level1, 2.

・remove 'wire' key for Qubit object
149th line and 156th line in /aqcel/optimization/pettern.py

#qbit = edge[2]['wire']
qbit = edge[2]

・comment out unused library
2nd line in /aqcel/optimization/slim.py

#from aqcel.optimization import RIIM_tools

・fix an undefined variable 'x' in gate loop
223th line in /aqcel/optimization/slim.py

#if (gate[1][x].register == delete_register) & (gate[1][x].index == delete_index):
if (gate[1][0].register == delete_register) & (gate[1][0].index == delete_index):

My qiskit version is
{'qiskit-terra': '0.19.1', 'qiskit-aer': '0.10.2', 'qiskit-ignis': '0.7.0', 'qiskit-ibmq-provider': '0.18.3',
'qiskit-aqua': '0.9.5', 'qiskit': '0.34.1', 'qiskit-nature': '0.3.0', 'qiskit-finance': '0.3.0',
'qiskit-optimization': '0.3.0', 'qiskit-machine-learning': '0.3.0'}.

@WonhoJang
Copy link
Collaborator

I am very sorry for the late reply, @pearcandy. Actually we will stop supporting quantum gate pattern recognition for a while. About the errors on circuit optimizations, try a new code and if you find similar bugs, please let me know.

Sincerely.

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

2 participants