Skip to content

Instantly share code, notes, and snippets.

View Q-lds's full-sized avatar

Leonardo Disilvestro Q-lds

View GitHub Profile
@Q-lds
Q-lds / aspen_m2_example.py
Created October 17, 2022 11:32
Targeting the Aspen-M-2
# Targetting a QPU is extremly easy
rigetti_aspen_m2 = create_device(location='qcs', name='Aspen-M-2', **qcs_credentials)
q.set_device(rigetti_aspen_m2)
@Q-lds
Q-lds / plot_oq.ipynb
Created October 17, 2022 11:19
Plotting the solution to [4,5,7,4]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Q-lds
Q-lds / Simplest_oq_workflow.py
Last active October 17, 2022 11:17
The simplest OpenQAOA workflow
from openqaoa.problems.problem import NumberPartition
from openqaoa.devices import create_device
from openqaoa.workflows.optimizer import QAOA
# Create the problem statement
np_qubo = NumberPartition(numbers=[5,6,7,4]).get_qubo_problem()
# Set up the QAOA object and customise it
q = QAOA()