Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/Azure/Azure.Quantum.Client/Machine/QuantumMachineFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Threading.Tasks;
using Microsoft.Quantum.Runtime;

namespace Microsoft.Azure.Quantum
Expand All @@ -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);
}
}
}