From f9e588671d7a45a13e62ef16b35de5e3e91a0544 Mon Sep 17 00:00:00 2001 From: Sarah Marshall Date: Mon, 18 May 2020 17:53:21 -0700 Subject: [PATCH] Add Honeywell to QuantumMachineFactory --- .../Machine/QuantumMachineFactory.cs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Azure/Azure.Quantum.Client/Machine/QuantumMachineFactory.cs b/src/Azure/Azure.Quantum.Client/Machine/QuantumMachineFactory.cs index d6ca6671156..ef9654c10ca 100644 --- a/src/Azure/Azure.Quantum.Client/Machine/QuantumMachineFactory.cs +++ b/src/Azure/Azure.Quantum.Client/Machine/QuantumMachineFactory.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.Threading.Tasks; using Microsoft.Quantum.Runtime; namespace Microsoft.Azure.Quantum @@ -23,16 +22,19 @@ public static class QuantumMachineFactory return null; } - if (targetName.StartsWith("ionq.")) - { - var ionQType = Type.GetType( - "Microsoft.Quantum.Providers.IonQ.Targets.IonQQuantumMachine, Microsoft.Quantum.Providers.IonQ", - throwOnError: true); - return (IQuantumMachine)Activator.CreateInstance( - ionQType, targetName, storageAccountConnectionString, workspace); - } - - return null; + var machineName = + targetName.StartsWith("ionq.") + ? "Microsoft.Quantum.Providers.IonQ.Targets.IonQQuantumMachine, Microsoft.Quantum.Providers.IonQ" + : targetName.StartsWith("honeywell.") + ? "Microsoft.Quantum.Providers.Honeywell.Targets.HoneywellQuantumMachine, Microsoft.Quantum.Providers.Honeywell" + : null; + return machineName is null + ? null + : (IQuantumMachine)Activator.CreateInstance( + Type.GetType(machineName, throwOnError: true), + targetName, + storageAccountConnectionString, + workspace); } } } \ No newline at end of file