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

QAOA run-problem-generation Error #323

Open
hmy98213 opened this issue Sep 16, 2022 · 0 comments
Open

QAOA run-problem-generation Error #323

hmy98213 opened this issue Sep 16, 2022 · 0 comments

Comments

@hmy98213
Copy link

I am running the "run-problem-generation.py" in

# Copyright 2020 Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from recirq.qaoa.experiments.problem_generation_tasks import SKProblemGenerationTask, \
HardwareGridProblemGenerationTask, ThreeRegularProblemGenerationTask, \
generate_3_regular_problem, generate_sk_problem, generate_hardware_grid_problem
def main():
dataset_id = '2020-03-19'
hardware_grid_problem_tasks = [
HardwareGridProblemGenerationTask(
dataset_id=dataset_id,
device_name='Sycamore23',
instance_i=i,
n_qubits=n
)
for i in range(100)
for n in range(2, 23 + 1)
]
sk_problem_tasks = [
SKProblemGenerationTask(
dataset_id=dataset_id,
instance_i=i,
n_qubits=n
)
for i in range(100)
for n in range(3, 17 + 1)
]
three_regular_problem_tasks = [
ThreeRegularProblemGenerationTask(
dataset_id=dataset_id,
instance_i=i,
n_qubits=n
)
for i in range(100)
for n in range(3, 23 + 1) if 3 * n % 2 == 0
]
for task in hardware_grid_problem_tasks:
generate_hardware_grid_problem(task)
for task in sk_problem_tasks:
generate_sk_problem(task)
for task in three_regular_problem_tasks:
generate_3_regular_problem(task)
if __name__ == '__main__':
main()

and got the following error:

Traceback (most recent call last):
  File "c:\Users\hmy98\iCloudDrive\Desktop\Test_Generator\qaoa_tutorial.py", line 60, in <module>
    main()
  File "c:\Users\hmy98\iCloudDrive\Desktop\Test_Generator\qaoa_tutorial.py", line 52, in main
    generate_hardware_grid_problem(task)
  File "C:\Users\hmy98\iCloudDrive\Desktop\Test_Generator\venv\lib\site-packages\recirq\qaoa\experiments\problem_generation_tasks.py", line 174, in generate_hardware_grid_problem        
    problem = _get_all_hardware_grid_problems(
  File "C:\Users\hmy98\iCloudDrive\Desktop\Test_Generator\venv\lib\site-packages\recirq\qaoa\experiments\problem_generation_tasks.py", line 156, in _get_all_hardware_grid_problems       
    device_graph = _get_device_graph(device_name=device_name)
  File "C:\Users\hmy98\iCloudDrive\Desktop\Test_Generator\venv\lib\site-packages\recirq\qaoa\experiments\problem_generation_tasks.py", line 121, in _get_device_graph
    device_graph = ccr.gridqubits_to_graph_device(device.qubits)
AttributeError: 'GridDevice' object has no attribute 'qubits'
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