This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Replace generated files in Quantum.Client with reference to the Azure.QuantumJobs package #697
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1dcc7a2
C# QIO API
mirounga a84430a
QIO implementation
mirounga 0e0bf1b
Converting to System.Text.Json
mirounga 8072393
QIO Test Project
mirounga fa63226
undo Simulation.sln
anpaz 74ad5e3
Update version
anpaz 565e4e2
Build 0.16.2105.140472.
ricardo-espinoza b1ff862
ignore snk files
anpaz e7e314d
Migrate Azure.Quantum.Client to use Azure.Quantum.Jobs
anpaz a761f1b
tests compile
anpaz 595ab9d
fixing entrypoint tests.
anpaz 591745f
Switching client tests to live environment
anpaz 9ff0bdc
quotas to AsyncEnumerable
anpaz db56230
Removing qio sample
anpaz ef675ed
Add description to Problem
anpaz 60c5a23
virtual cloudjob methods
anpaz dc494e1
Merge remote-tracking branch 'origin/main' into anpaz/track2
anpaz 1353f6f
skip live unittests
anpaz 8cdf286
Build 0.16.2105.143425.
anpaz 12d6735
credential, public client
anpaz 92fbf4c
Merge remote-tracking branch 'origin/main' into anpaz/track2
anpaz 7b5a323
Use env variables for live tests.
anpaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| *.snk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "msbuild-sdks": { | ||
| "Microsoft.Quantum.Sdk": "0.16.2105140327-beta" | ||
| "Microsoft.Quantum.Sdk": "0.16.2105143425-alpha" | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Text.Json; | ||
| using System.Text.Json.Serialization; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Microsoft.Azure.Quantum.Test | ||
| { | ||
| public enum ProblemType : int | ||
| { | ||
| PUBO = 0, | ||
| Ising = 1, | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// This is the data structure that represents a QIO problem payload on the service. | ||
| /// It's currently not exposed in C#, so we have it here so we can test job submission of | ||
| /// the client libraries without having to serialize Q# programs. | ||
| /// </summary> | ||
| public class Problem | ||
| { | ||
| private readonly HashSet<Term> terms = new HashSet<Term>(); | ||
|
|
||
| public Problem(ProblemType type = ProblemType.PUBO) | ||
| { | ||
| ProblemType = type; | ||
| } | ||
|
|
||
| public Problem(IEnumerable<Term> collection) | ||
| : this() | ||
| { | ||
| AddRange(collection); | ||
| } | ||
|
|
||
| [JsonPropertyName("version")] | ||
| public string Version => "1.1"; | ||
|
|
||
| [JsonPropertyName("type")] | ||
| [JsonConverter(typeof(JsonStringEnumConverter))] | ||
| public ProblemType ProblemType { get; } | ||
|
|
||
| [JsonPropertyName("terms")] | ||
| public IEnumerable<Term> Terms => terms; | ||
|
|
||
| public void Add(Term term) | ||
| { | ||
| terms.Add(term); | ||
| } | ||
|
|
||
| public void Add(int i, float c) | ||
| { | ||
| terms.Add(new Term(new int[] { i }, c)); | ||
| } | ||
|
|
||
| public void Add(int i, int j, float c) | ||
| { | ||
| terms.Add(new Term( new int[] { i, j }, c)); | ||
| } | ||
|
|
||
| public void Add(int i, int j, int k, float c) | ||
| { | ||
| terms.Add(new Term( new int[] { i, j, k }, c)); | ||
| } | ||
|
|
||
| public void AddRange(IEnumerable<Term> collection) | ||
| { | ||
| foreach (var term in collection) | ||
| { | ||
| terms.Add(term); | ||
| } | ||
| } | ||
|
|
||
| public Task SerializeAsync(Stream stream) | ||
| { | ||
| var root = new SerializationWrapper | ||
| { | ||
| CostFunction = this, | ||
| }; | ||
|
|
||
| // Save to the writer | ||
| return JsonSerializer.SerializeAsync(stream, root); | ||
| } | ||
|
|
||
| public override string ToString() | ||
| { | ||
| var root = new SerializationWrapper | ||
| { | ||
| CostFunction = this, | ||
| }; | ||
|
|
||
| return JsonSerializer.Serialize(root); | ||
| } | ||
|
|
||
| private struct SerializationWrapper | ||
| { | ||
| [JsonPropertyName("cost_function")] | ||
| public Problem CostFunction { get; set; } | ||
| } | ||
|
|
||
| public class Term | ||
| { | ||
| public Term(int[] ids, float c) | ||
| { | ||
| this.IDs = ids; | ||
| this.Weight = c; | ||
| } | ||
|
|
||
| [JsonPropertyName("c")] | ||
| public float Weight { get; } | ||
|
|
||
| [JsonPropertyName("ids")] | ||
| public int[] IDs { get; } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.