Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@cesarzc
Copy link
Contributor

@cesarzc cesarzc commented May 27, 2020

This change handles two known exceptions that can happen when submitting/executing a program in Azure quantum:

  • AzureQuantumException
  • QuantumProcessorTranslationException

@cesarzc cesarzc requested review from anpaz, bamarsha and swernli May 27, 2020 20:02
cesarzc and others added 4 commits May 27, 2020 14:48
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
@cesarzc cesarzc merged commit e8332ac into feature/azure-quantum-preview May 27, 2020
bamarsha added a commit that referenced this pull request May 28, 2020
)

* Create new project for entry point driver

* Fix entry point option values

* Add missing dashes to simulator options

* Update root namespace

* Add driver to nuget package

* Manually add EntryPointDriver's dependencies to package

* Add doc comments to Validation

* Rewrite FindNuspecReferences.ps1

* Type parameterize IEntryPoint

* Add reference to EntryPointDriver from tests

* Remove entry point driver resources

* Rename EntryPointDriver assembly

* Remove unneeded generated code

* Add documentation to IEntryPoint

* Update Driver documentation

* Enable C# nullable feature

* Avoid multiple enumeration

* Remove unnecessary identifier quotations

* Remove "Get" prefix

* Update variable name/comment

* Make Validation and value parsers private/internal

* Support IQArray types directly

* Remove single-class namespace

* Use type parameter in CreateOption

* Combine some excessively separated functions

* Use WithSuggestions instead of AddSuggestions

* Add entry point argument tuple to interface

* Fix nested tuples in arguments

* Add entry point info to IEntryPoint

* Add submit command

* Fix typo

Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>

* Use only one line for shadowing warning

* Removed type parameters from IQuantumMachine interface. (#185)

* Removed type parameters from IQuantumMachine interface.

* Addressed Sarah's feedback.

* Update src/Simulation/Core/IQuantumMachineOutput.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Use the new IQuantumMachine interface

* Add TODO for histogram output

* Add command-line options for Azure submission

* Small code style fixes

* Use real provider for Azure submission

* Remove TODO from the wrong place

* Use SimulatorMachine based on target name

* Add option for number of shots

* Validate that shots is positive

* Use DefaultIfShadowed for Azure settings

* Simplify adding/defaulting options

* Make SimulatorOption non-static

* Add AddOptionsIfAvailable method

* Fix option aliases missing dashes

* Disable command if required options are shadowed

* Add copyright headers

* Add histogram option

* Make histogram pretty

* Fix shadowing

* Update histogram divider dash

* Preserve required state of options

* Simulator option is not required

* Use SubmitAsync instead of ExecuteAsync

* Add access token option

* Rename ToWorkspace to CreateWorkspace

* Remove "Azure" from option descriptions

* Print job ID instead of URI for now

* Add --base-uri option

* Rename --access to --aad-token

* Rename --id-only to --output

* Add OptionInfo class

* Update --shots validator message

* Update --base-uri description

* Add TODO for "submit" tests

* Replace NotImplementedExceptions with NotSupportedExceptions

* More specific TODO for number of shots

* Don't include default value for required options

* Hide "submit" command

* Update help test

* Add manifest with qsharp-runtime assemblies requiring signing (#200) (#202)

* Add manifest with assemblies requiring signing

* Add manifest.ps1 to build steps

* Run manifest after build completes

* Fix manifest.ps1 script error

* Fix to manifest.ps1

* Revert unnecessary commit 466dc8c

* Update TODO comments

* Add test for submit help text

* Add more tests for submit command

* Add Microsoft.Azure.Quantum.Client sources and QuantumMachineFactory (#203)

* Add Microsoft.Azure.Quantum.Client sources

* Add project reference to Microsoft.Quantum.Runtime.Core

* Add reference to Microsoft.Azure.Quantum.Client

* Re-add missing summary start tag

* Add Honeywell to QuantumMachineFactory

* Allow reflection to find type in loaded assembly (#205)

* Update reflection to look for signed assembly first

* Use IWorkspace instead of Workspace

* Catch exceptions from GetType call

* Use package references to runtime components in EntryPointDriver

* Revert package references to project references

* Add Microsoft.Azure.Quantum.Client as NuGet dependency

* Add stubs for new methods in NothingMachine

* Add --dry-run option

* Set shots in submission context

* Add blank line before validation message

* Created AzzureQuantumException. (#216)

This change adds AzureQuantumException which is the base exception to throw or create new exceptions related to the Azure quantum service or storage.

* Merge latest master to have access to QuantumProcessorTranslationException (#217)

* Created QuantumProcessorException (#212)

* Created QuantumProcessorException.

* Provided a default message but added the option to supply a custom one.

* Renamed to QuantumProcessorTranslationException.

* Improved the default message.

* Updating placeholder names to provider names (#215)

Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>

* Show warning message for OutputFormat.FriendlyUri

* Fix tests

* Rename test project

* Add test for unknown target

* Add test project to test.ps1

* Handle Azure quantum known exceptions (#218)

* Add the three standard constructors for the newly created exceptions.

* Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic.

* Removed exception that is not needed.

* Improved error message.

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update copyright headers in Azure Quantum client

* Remove TODO for audience URI

Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
Co-authored-by: César Zaragoza Cortés <cesar.zaragoza@outlook.com>
Co-authored-by: Ryan Shaffer <ryan.shaffer@microsoft.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
bamarsha added a commit that referenced this pull request May 28, 2020
* Add the three standard constructors for the newly created exceptions.

* Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic.

* Removed exception that is not needed.

* Improved error message.

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>
AniketDalvi pushed a commit that referenced this pull request Jul 1, 2020
)

* Create new project for entry point driver

* Fix entry point option values

* Add missing dashes to simulator options

* Update root namespace

* Add driver to nuget package

* Manually add EntryPointDriver's dependencies to package

* Add doc comments to Validation

* Rewrite FindNuspecReferences.ps1

* Type parameterize IEntryPoint

* Add reference to EntryPointDriver from tests

* Remove entry point driver resources

* Rename EntryPointDriver assembly

* Remove unneeded generated code

* Add documentation to IEntryPoint

* Update Driver documentation

* Enable C# nullable feature

* Avoid multiple enumeration

* Remove unnecessary identifier quotations

* Remove "Get" prefix

* Update variable name/comment

* Make Validation and value parsers private/internal

* Support IQArray types directly

* Remove single-class namespace

* Use type parameter in CreateOption

* Combine some excessively separated functions

* Use WithSuggestions instead of AddSuggestions

* Add entry point argument tuple to interface

* Fix nested tuples in arguments

* Add entry point info to IEntryPoint

* Add submit command

* Fix typo

Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>

* Use only one line for shadowing warning

* Removed type parameters from IQuantumMachine interface. (#185)

* Removed type parameters from IQuantumMachine interface.

* Addressed Sarah's feedback.

* Update src/Simulation/Core/IQuantumMachineOutput.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Use the new IQuantumMachine interface

* Add TODO for histogram output

* Add command-line options for Azure submission

* Small code style fixes

* Use real provider for Azure submission

* Remove TODO from the wrong place

* Use SimulatorMachine based on target name

* Add option for number of shots

* Validate that shots is positive

* Use DefaultIfShadowed for Azure settings

* Simplify adding/defaulting options

* Make SimulatorOption non-static

* Add AddOptionsIfAvailable method

* Fix option aliases missing dashes

* Disable command if required options are shadowed

* Add copyright headers

* Add histogram option

* Make histogram pretty

* Fix shadowing

* Update histogram divider dash

* Preserve required state of options

* Simulator option is not required

* Use SubmitAsync instead of ExecuteAsync

* Add access token option

* Rename ToWorkspace to CreateWorkspace

* Remove "Azure" from option descriptions

* Print job ID instead of URI for now

* Add --base-uri option

* Rename --access to --aad-token

* Rename --id-only to --output

* Add OptionInfo class

* Update --shots validator message

* Update --base-uri description

* Add TODO for "submit" tests

* Replace NotImplementedExceptions with NotSupportedExceptions

* More specific TODO for number of shots

* Don't include default value for required options

* Hide "submit" command

* Update help test

* Add manifest with qsharp-runtime assemblies requiring signing (#200) (#202)

* Add manifest with assemblies requiring signing

* Add manifest.ps1 to build steps

* Run manifest after build completes

* Fix manifest.ps1 script error

* Fix to manifest.ps1

* Revert unnecessary commit 466dc8c

* Update TODO comments

* Add test for submit help text

* Add more tests for submit command

* Add Microsoft.Azure.Quantum.Client sources and QuantumMachineFactory (#203)

* Add Microsoft.Azure.Quantum.Client sources

* Add project reference to Microsoft.Quantum.Runtime.Core

* Add reference to Microsoft.Azure.Quantum.Client

* Re-add missing summary start tag

* Add Honeywell to QuantumMachineFactory

* Allow reflection to find type in loaded assembly (#205)

* Update reflection to look for signed assembly first

* Use IWorkspace instead of Workspace

* Catch exceptions from GetType call

* Use package references to runtime components in EntryPointDriver

* Revert package references to project references

* Add Microsoft.Azure.Quantum.Client as NuGet dependency

* Add stubs for new methods in NothingMachine

* Add --dry-run option

* Set shots in submission context

* Add blank line before validation message

* Created AzzureQuantumException. (#216)

This change adds AzureQuantumException which is the base exception to throw or create new exceptions related to the Azure quantum service or storage.

* Merge latest master to have access to QuantumProcessorTranslationException (#217)

* Created QuantumProcessorException (#212)

* Created QuantumProcessorException.

* Provided a default message but added the option to supply a custom one.

* Renamed to QuantumProcessorTranslationException.

* Improved the default message.

* Updating placeholder names to provider names (#215)

Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>

* Show warning message for OutputFormat.FriendlyUri

* Fix tests

* Rename test project

* Add test for unknown target

* Add test project to test.ps1

* Handle Azure quantum known exceptions (#218)

* Add the three standard constructors for the newly created exceptions.

* Created QuantumMachineClientException and incorporated it (and other exceptions) into the standalone logic.

* Removed exception that is not needed.

* Improved error message.

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update src/Simulation/EntryPointDriver/Azure.cs

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

Co-authored-by: Sarah Marshall <33814365+samarsha@users.noreply.github.com>

* Update copyright headers in Azure Quantum client

* Remove TODO for audience URI

Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
Co-authored-by: César Zaragoza Cortés <cesar.zaragoza@outlook.com>
Co-authored-by: Ryan Shaffer <ryan.shaffer@microsoft.com>
Co-authored-by: Stefan J. Wernli <swernli@microsoft.com>
@bettinaheim bettinaheim deleted the cesarzc/azure-quantum-exception-handling branch August 7, 2020 22:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants