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

uploading a StreamingProblem with initial configuration has incorrect formatting causing jobs to fail #341

Open
frtibble opened this issue Jun 22, 2022 · 0 comments
Assignees
Labels
azure-quantum bug Something isn't working

Comments

@frtibble
Copy link
Contributor

When creating a StreamingProblem with an initial configuration applied, the QDK conversion for the problem into JSON is incorrect, causing submissions to Azure Quantum to fail. For example the problem:

from azure.quantum.optimization import StreamingProblem, Term, ParallelTempering

terms = [
    Term(c=-9, indices=[0]),
    Term(c=-3, indices=[1,0]),
    Term(c=5, indices=[2,0])
]

# with initial configuration set
config = {'0': 1, '1': 1, '2': 0}
problem = StreamingProblem(workspace, name="Problem with Initial Configuration", terms=terms, initial_config=config)
solver = ParallelTempering(workspace, timeout=100)
url = problem.upload(workspace)
job = solver.submit(url)
job.get_results()

Is incorrectly formatted as:

{"cost_function":{"version":"1.1","type":"ising",initial_configuration{"0": 1, "1": 1, "2": 0},"terms":[{"c": -9, "ids": [0]},{"c": -3, "ids": [1, 0]},{"c": 5, "ids": [2, 0]}]}}

which is not valid JSON.

@frtibble frtibble self-assigned this Jun 22, 2022
@frtibble frtibble added bug Something isn't working azure-quantum labels Jun 22, 2022
@frtibble frtibble changed the title uploading streaming problems with initial configuration has incorrect formatting causing jobs to fail uploading a StreamingProblem with initial configuration has incorrect formatting causing jobs to fail Jun 22, 2022
@frtibble frtibble linked a pull request Jun 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-quantum bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants