From c10a2a9c9e857637c9acc20fc20f42cff2c9d380 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Thu, 25 Feb 2021 23:07:43 -0800 Subject: [PATCH 1/3] Update concrete intrinsic naming conventions This change updates the naming conventions for concrete intrinsics in generated C# and the corresponding interfaces to avoid "gate" terminology. This makes the infrastructure more generic, easier to invoke, and better for use in places besides quantum instruction specific target packages. --- .../CSharpGeneration/SimulationCode.fs | 11 +- src/Simulation/QSharpCore/Intrinsic.cs | 120 +++++++++--------- .../QCTraceSimulator.Primitive.Measure.cs | 3 +- .../QCTraceSimulator/QCTraceSimulatorImpl.cs | 2 +- .../QuantumSimulator/ApplyControlledX.cs | 3 +- .../QuantumSimulator/ApplyControlledZ.cs | 3 +- .../QuantumSimulator/ApplyUncontrolledH.cs | 3 +- .../QuantumSimulator/ApplyUncontrolledRx.cs | 7 +- .../QuantumSimulator/ApplyUncontrolledRy.cs | 7 +- .../QuantumSimulator/ApplyUncontrolledRz.cs | 7 +- .../QuantumSimulator/ApplyUncontrolledS.cs | 5 +- .../QuantumSimulator/ApplyUncontrolledSWAP.cs | 3 +- .../QuantumSimulator/ApplyUncontrolledT.cs | 5 +- .../QuantumSimulator/ApplyUncontrolledX.cs | 3 +- .../QuantumSimulator/ApplyUncontrolledY.cs | 3 +- .../QuantumSimulator/ApplyUncontrolledZ.cs | 3 +- .../Simulators/QuantumSimulator/Exp.cs | 15 ++- .../Simulators/QuantumSimulator/H.cs | 7 +- .../Simulators/QuantumSimulator/IsingXX.cs | 15 ++- .../Simulators/QuantumSimulator/IsingYY.cs | 15 ++- .../Simulators/QuantumSimulator/IsingZZ.cs | 15 ++- .../Simulators/QuantumSimulator/M.cs | 3 +- .../Simulators/QuantumSimulator/Measure.cs | 3 +- .../Simulators/QuantumSimulator/R.cs | 15 ++- .../Simulators/QuantumSimulator/Random.cs | 26 ---- .../Simulators/QuantumSimulator/Reset.cs | 3 +- .../Simulators/QuantumSimulator/Rx.cs | 13 +- .../Simulators/QuantumSimulator/Ry.cs | 13 +- .../Simulators/QuantumSimulator/Rz.cs | 13 +- .../Simulators/QuantumSimulator/S.cs | 13 +- .../Simulators/QuantumSimulator/SWAP.cs | 7 +- .../Simulators/QuantumSimulator/T.cs | 13 +- .../Simulators/QuantumSimulator/X.cs | 7 +- .../Simulators/QuantumSimulator/Y.cs | 7 +- .../Simulators/QuantumSimulator/Z.cs | 7 +- .../Simulators/ToffoliSimulator/Exp.cs | 9 +- .../Simulators/ToffoliSimulator/H.cs | 5 +- .../Simulators/ToffoliSimulator/Measure.cs | 3 +- .../Simulators/ToffoliSimulator/R.cs | 9 +- .../Simulators/ToffoliSimulator/Random.cs | 36 ------ .../Simulators/ToffoliSimulator/S.cs | 9 +- .../Simulators/ToffoliSimulator/T.cs | 9 +- .../Simulators/ToffoliSimulator/X.cs | 6 +- .../Simulators/ToffoliSimulator/Y.cs | 5 +- .../Simulators/ToffoliSimulator/Z.cs | 5 +- .../Interfaces/IGate_ApplyControlledX.cs | 4 +- .../Interfaces/IGate_ApplyControlledZ.cs | 4 +- .../Interfaces/IGate_ApplyUncontrolledH.cs | 4 +- .../Interfaces/IGate_ApplyUncontrolledRx.cs | 6 +- .../Interfaces/IGate_ApplyUncontrolledRy.cs | 6 +- .../Interfaces/IGate_ApplyUncontrolledRz.cs | 6 +- .../Interfaces/IGate_ApplyUncontrolledS.cs | 6 +- .../Interfaces/IGate_ApplyUncontrolledSWAP.cs | 4 +- .../Interfaces/IGate_ApplyUncontrolledT.cs | 6 +- .../Interfaces/IGate_ApplyUncontrolledX.cs | 4 +- .../Interfaces/IGate_ApplyUncontrolledY.cs | 4 +- .../Interfaces/IGate_ApplyUncontrolledZ.cs | 4 +- .../TargetDefinitions/Interfaces/IGate_Exp.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_H.cs | 6 +- .../Interfaces/IGate_IsingXX.cs | 10 +- .../Interfaces/IGate_IsingYY.cs | 10 +- .../Interfaces/IGate_IsingZZ.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_M.cs | 4 +- .../Interfaces/IGate_Measure.cs | 4 +- .../TargetDefinitions/Interfaces/IGate_R.cs | 10 +- .../Interfaces/IGate_Reset.cs | 4 +- .../TargetDefinitions/Interfaces/IGate_Rx.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_Ry.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_Rz.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_S.cs | 10 +- .../Interfaces/IGate_SWAP.cs | 6 +- .../TargetDefinitions/Interfaces/IGate_T.cs | 10 +- .../TargetDefinitions/Interfaces/IGate_X.cs | 6 +- .../TargetDefinitions/Interfaces/IGate_Y.cs | 6 +- .../TargetDefinitions/Interfaces/IGate_Z.cs | 6 +- .../Interfaces/IQSharpCore.cs | 18 +-- .../Interfaces/IType1Core.cs | 26 ++-- .../Interfaces/IType2Core.cs | 28 ++-- .../Interfaces/IType3Core.cs | 28 ++-- 79 files changed, 386 insertions(+), 408 deletions(-) delete mode 100644 src/Simulation/Simulators/QuantumSimulator/Random.cs delete mode 100644 src/Simulation/Simulators/ToffoliSimulator/Random.cs diff --git a/src/Simulation/CSharpGeneration/SimulationCode.fs b/src/Simulation/CSharpGeneration/SimulationCode.fs index f8fa92a5e65..b2e1f7606cf 100644 --- a/src/Simulation/CSharpGeneration/SimulationCode.fs +++ b/src/Simulation/CSharpGeneration/SimulationCode.fs @@ -937,7 +937,7 @@ module SimulationCode = [ ``public`` ] ``{`` [ - (``ident`` "this") <|.|> (``ident`` "Gate") <-- (``ident`` "m") |~> ("IGate_" + name) |> statement + (``ident`` "this") <|.|> (``ident`` "Impl") <-- (``ident`` "m") |> statement ] ``}`` :> MemberDeclarationSyntax @@ -1041,7 +1041,6 @@ module SimulationCode = | _ -> op.ArgumentTuple let argName, argsInit = getInputVarWithInit args let specCall = - (userDefinedName None op.FullName.Name) + "__" + match sp.Kind with | QsBody -> "" | QsAdjoint -> "Adjoint" @@ -1052,7 +1051,7 @@ module SimulationCode = let rec argsToVars = function | QsTupleItem one -> [one.VariableName |> name] | QsTuple many -> many |> Seq.map argsToVars |> List.concat - let callExp = (``ident`` "Gate") <.> (``ident`` specCall, argsToVars args) + let callExp = ``((`` (``cast`` ("IIntrinsic" + (userDefinedName None op.FullName.Name)) (``ident`` "Impl")) ``))`` <.> (``ident`` specCall, argsToVars args) let statements = match sp.Signature.ReturnType.Resolution with | QsTypeKind.UnitType -> @@ -1278,8 +1277,8 @@ module SimulationCode = ``get`` (``=>`` (``literal`` name) ) :> MemberDeclarationSyntax - let buildGate name = - ``propg`` ("IGate_" + name) "Gate" [ ``private``; ``protected`` ] + let buildImpl name = + ``propg`` "IOperationFactory" "Impl" [ ``private``; ``protected`` ] :> MemberDeclarationSyntax let buildFullName (name : QsQualifiedName) = @@ -1461,7 +1460,7 @@ module SimulationCode = yield buildFullName context.current.Value if globalContext.entryPoints |> Seq.contains op.FullName then yield buildOperationInfoProperty globalContext inType outType nonGenericName - if isConcreteIntrinsic then yield buildGate name + if isConcreteIntrinsic then yield buildImpl name yield! opProperties ] diff --git a/src/Simulation/QSharpCore/Intrinsic.cs b/src/Simulation/QSharpCore/Intrinsic.cs index 9433518163b..bbc9740fab5 100644 --- a/src/Simulation/QSharpCore/Intrinsic.cs +++ b/src/Simulation/QSharpCore/Intrinsic.cs @@ -89,112 +89,114 @@ public partial class ResetAll } } - - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimExp : Exp + public class QSimLegacy { - public QSimExp(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimExp : Exp { + public QSimExp(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimExpFrac : ExpFrac - { - public QSimExpFrac(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimExpFrac : ExpFrac { + public QSimExpFrac(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimH : H - { - public QSimH(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimH : H { + public QSimH(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimM : M - { - public QSimM(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimM : M { + public QSimM(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimMeasure : Measure - { - public QSimMeasure(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimMeasure : Measure { + public QSimMeasure(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimR : R - { - public QSimR(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimR : R { + public QSimR(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimRFrac : RFrac - { - public QSimRFrac(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimRFrac : RFrac { + public QSimRFrac(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimS : S - { - public QSimS(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimS : S { + public QSimS(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimT : T - { - public QSimT(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimT : T { + public QSimT(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimX : X - { - public QSimX(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimX : X { + public QSimX(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimY : Y - { - public QSimY(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimY : Y { + public QSimY(IOperationFactory factory) : base(factory) + { + } } - } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimZ : Z - { - public QSimZ(IOperationFactory factory) : base(factory) + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimZ : Z { + public QSimZ(IOperationFactory factory) : base(factory) + { + } } } } diff --git a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulator.Primitive.Measure.cs b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulator.Primitive.Measure.cs index b13a03116da..907e6378d4e 100644 --- a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulator.Primitive.Measure.cs +++ b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulator.Primitive.Measure.cs @@ -5,10 +5,11 @@ namespace Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.Implementati { using System; using Microsoft.Quantum.Simulation.Core; + using Microsoft.Quantum.Intrinsic.Interfaces; public partial class QCTraceSimulatorImpl { - public virtual Result Measure__Body(IQArray paulis, IQArray targets) + Result IIntrinsicMeasure.Body(IQArray paulis, IQArray targets) { return this.Measure(paulis, targets); } diff --git a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs index 4e614f5a524..5d37224316e 100644 --- a/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs +++ b/src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs @@ -16,7 +16,7 @@ namespace Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators.Implementati /// /// Internals of . For internal use only. /// - public partial class QCTraceSimulatorImpl : SimulatorBase, IGate_Measure + public partial class QCTraceSimulatorImpl : SimulatorBase, IIntrinsicMeasure { protected readonly QCTraceSimulatorConfiguration configuration; private readonly QCTraceSimulatorCore tracingCore; diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyControlledX.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyControlledX.cs index 63f155fd82e..f8c3a68e3ef 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyControlledX.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyControlledX.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyControlledX__Body(Qubit control, Qubit target) + void IIntrinsicApplyControlledX.Body(Qubit control, Qubit target) { this.CheckQubits(new QArray(new Qubit[]{ control, target })); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyControlledZ.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyControlledZ.cs index 5fff7c75896..1f0ae75acdc 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyControlledZ.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyControlledZ.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyControlledZ__Body(Qubit control, Qubit target) + void IIntrinsicApplyControlledZ.Body(Qubit control, Qubit target) { this.CheckQubits(new QArray(new Qubit[]{ control, target })); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledH.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledH.cs index 274a2801506..242d2bfa069 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledH.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledH.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledH__Body(Qubit target) + void IIntrinsicApplyUncontrolledH.Body(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRx.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRx.cs index d20ed65cdfa..7bce94d0644 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRx.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRx.cs @@ -2,21 +2,22 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledRx__Body(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRx.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliX, angle, (uint)target.Id); } - public virtual void ApplyUncontrolledRx__AdjointBody(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRx.AdjointBody(double angle, Qubit target) { - ApplyUncontrolledRx__Body(-angle, target); + ((IIntrinsicApplyUncontrolledRx)this).Body(-angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRy.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRy.cs index b8f7b623790..4dad6b04f55 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRy.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRy.cs @@ -2,21 +2,22 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledRy__Body(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRy.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliY, angle, (uint)target.Id); } - public virtual void ApplyUncontrolledRy__AdjointBody(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRy.AdjointBody(double angle, Qubit target) { - ApplyUncontrolledRy__Body(-angle, target); + ((IIntrinsicApplyUncontrolledRy)this).Body(-angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRz.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRz.cs index 5227619f2c1..0c28ea37075 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRz.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledRz.cs @@ -2,21 +2,22 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledRz__Body(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRz.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliZ, angle, (uint)target.Id); } - public virtual void ApplyUncontrolledRz__AdjointBody(double angle, Qubit target) + void IIntrinsicApplyUncontrolledRz.AdjointBody(double angle, Qubit target) { - ApplyUncontrolledRz__Body(-angle, target); + ((IIntrinsicApplyUncontrolledRz)this).Body(-angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledS.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledS.cs index 6398e5de92d..680617dfbed 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledS.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledS.cs @@ -2,19 +2,20 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledS__Body(Qubit target) + void IIntrinsicApplyUncontrolledS.Body(Qubit target) { this.CheckQubit(target); S(this.Id, (uint)target.Id); } - public virtual void ApplyUncontrolledS__AdjointBody(Qubit target) + void IIntrinsicApplyUncontrolledS.AdjointBody(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledSWAP.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledSWAP.cs index de99bdeec47..733db0889a2 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledSWAP.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledSWAP.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledSWAP__Body(Qubit qubit1, Qubit qubit2) + void IIntrinsicApplyUncontrolledSWAP.Body(Qubit qubit1, Qubit qubit2) { // Issue #44 (https://github.com/microsoft/qsharp-runtime/issues/44) // If/when the simulator provides access to the accelerated SWAP functionality, diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledT.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledT.cs index f371a01c766..ce00cb8bc1e 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledT.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledT.cs @@ -2,19 +2,20 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledT__Body(Qubit target) + void IIntrinsicApplyUncontrolledT.Body(Qubit target) { this.CheckQubit(target); T(this.Id, (uint)target.Id); } - public virtual void ApplyUncontrolledT__AdjointBody(Qubit target) + void IIntrinsicApplyUncontrolledT.AdjointBody(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledX.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledX.cs index fd34d8e56ed..673ca0742da 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledX.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledX.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledX__Body(Qubit target) + void IIntrinsicApplyUncontrolledX.Body(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledY.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledY.cs index 064773160bc..3f1d13c6a53 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledY.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledY.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledY__Body(Qubit target) + void IIntrinsicApplyUncontrolledY.Body(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledZ.cs b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledZ.cs index 4e08dcda810..10d6d31aca8 100644 --- a/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledZ.cs +++ b/src/Simulation/Simulators/QuantumSimulator/ApplyUncontrolledZ.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void ApplyUncontrolledZ__Body(Qubit target) + void IIntrinsicApplyUncontrolledZ.Body(Qubit target) { this.CheckQubit(target); diff --git a/src/Simulation/Simulators/QuantumSimulator/Exp.cs b/src/Simulation/Simulators/QuantumSimulator/Exp.cs index a9450d1c388..9d1b11511f4 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Exp.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Exp.cs @@ -3,12 +3,13 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Exp__Body(IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.Body(IQArray paulis, double angle, IQArray targets) { this.CheckQubits(targets); CheckAngle(angle); @@ -21,12 +22,12 @@ public virtual void Exp__Body(IQArray paulis, double angle, IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.AdjointBody(IQArray paulis, double angle, IQArray targets) { - Exp__Body(paulis, -angle, targets); + ((IIntrinsicExp)this).Body(paulis, -angle, targets); } - public virtual void Exp__ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets) { this.CheckQubits(controls, targets); CheckAngle(angle); @@ -37,13 +38,13 @@ public virtual void Exp__ControlledBody(IQArray controls, IQArray } SafeControlled(controls, - () => Exp__Body(paulis, angle, targets), + () => ((IIntrinsicExp)this).Body(paulis, angle, targets), (count, ids) => MCExp(this.Id, (uint)paulis.Length, paulis.ToArray(), angle, count, ids, targets.GetIds())); } - public virtual void Exp__ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets) { - Exp__ControlledBody(controls, paulis, -angle, targets); + ((IIntrinsicExp)this).ControlledBody(controls, paulis, -angle, targets); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/H.cs b/src/Simulation/Simulators/QuantumSimulator/H.cs index 4b8a954bdd8..3df34308f06 100644 --- a/src/Simulation/Simulators/QuantumSimulator/H.cs +++ b/src/Simulation/Simulators/QuantumSimulator/H.cs @@ -2,24 +2,25 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void H__Body(Qubit target) + void IIntrinsicH.Body(Qubit target) { this.CheckQubit(target); H(this.Id, (uint)target.Id); } - public virtual void H__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicH.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => H__Body(target), + () => ((IIntrinsicH)this).Body(target), (count, ids) => MCH(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/QuantumSimulator/IsingXX.cs b/src/Simulation/Simulators/QuantumSimulator/IsingXX.cs index e3283033548..f372f9a02de 100644 --- a/src/Simulation/Simulators/QuantumSimulator/IsingXX.cs +++ b/src/Simulation/Simulators/QuantumSimulator/IsingXX.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void IsingXX__Body(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingXX.Body(double angle, Qubit target1, Qubit target2) { var paulis = new Pauli[]{ Pauli.PauliX, Pauli.PauliX }; var targets = new QArray(new Qubit[]{ target1, target2 }); @@ -17,16 +18,16 @@ public virtual void IsingXX__Body(double angle, Qubit target1, Qubit target2) Exp(this.Id, (uint)targets.Length, paulis, angle * 2.0, targets.GetIds()); } - public virtual void IsingXX__AdjointBody(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingXX.AdjointBody(double angle, Qubit target1, Qubit target2) { - IsingXX__Body(-angle, target1, target2); + ((IIntrinsicIsingXX)this).Body(-angle, target1, target2); } - public virtual void IsingXX__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingXX.ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) { if (controls == null || controls.Length == 0) { - IsingXX__Body(angle, target1, target2); + ((IIntrinsicIsingXX)this).Body(angle, target1, target2); } else { @@ -39,9 +40,9 @@ public virtual void IsingXX__ControlledBody(IQArray controls, double angl } } - public virtual void IsingXX__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingXX.ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) { - IsingXX__ControlledBody(controls, -angle, target1, target2); + ((IIntrinsicIsingXX)this).ControlledBody(controls, -angle, target1, target2); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/IsingYY.cs b/src/Simulation/Simulators/QuantumSimulator/IsingYY.cs index 11338a1576d..c733988a2cd 100644 --- a/src/Simulation/Simulators/QuantumSimulator/IsingYY.cs +++ b/src/Simulation/Simulators/QuantumSimulator/IsingYY.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void IsingYY__Body(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingYY.Body(double angle, Qubit target1, Qubit target2) { var paulis = new Pauli[]{ Pauli.PauliY, Pauli.PauliY }; var targets = new QArray(new Qubit[]{ target1, target2 }); @@ -17,16 +18,16 @@ public virtual void IsingYY__Body(double angle, Qubit target1, Qubit target2) Exp(this.Id, (uint)targets.Length, paulis, angle * 2.0, targets.GetIds()); } - public virtual void IsingYY__AdjointBody(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingYY.AdjointBody(double angle, Qubit target1, Qubit target2) { - IsingYY__Body(-angle, target1, target2); + ((IIntrinsicIsingYY)this).Body(-angle, target1, target2); } - public virtual void IsingYY__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingYY.ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) { if (controls == null || controls.Length == 0) { - IsingYY__Body(angle, target1, target2); + ((IIntrinsicIsingYY)this).Body(angle, target1, target2); } else { @@ -39,9 +40,9 @@ public virtual void IsingYY__ControlledBody(IQArray controls, double angl } } - public virtual void IsingYY__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingYY.ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) { - IsingYY__ControlledBody(controls, -angle, target1, target2); + ((IIntrinsicIsingYY)this).ControlledBody(controls, -angle, target1, target2); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/IsingZZ.cs b/src/Simulation/Simulators/QuantumSimulator/IsingZZ.cs index 8d182817fae..e19c69347d3 100644 --- a/src/Simulation/Simulators/QuantumSimulator/IsingZZ.cs +++ b/src/Simulation/Simulators/QuantumSimulator/IsingZZ.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void IsingZZ__Body(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingZZ.Body(double angle, Qubit target1, Qubit target2) { var paulis = new Pauli[]{ Pauli.PauliZ, Pauli.PauliZ }; var targets = new QArray(new Qubit[]{ target1, target2 }); @@ -17,16 +18,16 @@ public virtual void IsingZZ__Body(double angle, Qubit target1, Qubit target2) Exp(this.Id, (uint)targets.Length, paulis, angle * 2.0, targets.GetIds()); } - public virtual void IsingZZ__AdjointBody(double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingZZ.AdjointBody(double angle, Qubit target1, Qubit target2) { - IsingZZ__Body(-angle, target1, target2); + ((IIntrinsicIsingZZ)this).Body(-angle, target1, target2); } - public virtual void IsingZZ__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingZZ.ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2) { if (controls == null || controls.Length == 0) { - IsingZZ__Body(angle, target1, target2); + ((IIntrinsicIsingZZ)this).Body(angle, target1, target2); } else { @@ -39,9 +40,9 @@ public virtual void IsingZZ__ControlledBody(IQArray controls, double angl } } - public virtual void IsingZZ__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) + void IIntrinsicIsingZZ.ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2) { - IsingZZ__ControlledBody(controls, -angle, target1, target2); + ((IIntrinsicIsingZZ)this).ControlledBody(controls, -angle, target1, target2); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/M.cs b/src/Simulation/Simulators/QuantumSimulator/M.cs index 51afcaf347c..0777dd05c54 100644 --- a/src/Simulation/Simulators/QuantumSimulator/M.cs +++ b/src/Simulation/Simulators/QuantumSimulator/M.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual Result M__Body(Qubit target) + Result IIntrinsicM.Body(Qubit target) { this.CheckQubit(target); //setting qubit as measured to allow for release diff --git a/src/Simulation/Simulators/QuantumSimulator/Measure.cs b/src/Simulation/Simulators/QuantumSimulator/Measure.cs index 630d2a1fbcf..4ed4696dad0 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Measure.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Measure.cs @@ -3,12 +3,13 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual Result Measure__Body(IQArray paulis, IQArray targets) + Result IIntrinsicMeasure.Body(IQArray paulis, IQArray targets) { this.CheckQubits(targets); if (paulis.Length != targets.Length) diff --git a/src/Simulation/Simulators/QuantumSimulator/R.cs b/src/Simulation/Simulators/QuantumSimulator/R.cs index 9308e6f49b5..e0597eb2783 100644 --- a/src/Simulation/Simulators/QuantumSimulator/R.cs +++ b/src/Simulation/Simulators/QuantumSimulator/R.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void R__Body(Pauli pauli, double angle, Qubit target) + void IIntrinsicR.Body(Pauli pauli, double angle, Qubit target) { this.CheckQubit(target); CheckAngle(angle); @@ -15,25 +16,25 @@ public virtual void R__Body(Pauli pauli, double angle, Qubit target) R(this.Id, pauli, angle, (uint)target.Id); } - public virtual void R__AdjointBody(Pauli pauli, double angle, Qubit target) + void IIntrinsicR.AdjointBody(Pauli pauli, double angle, Qubit target) { - R__Body(pauli, -angle, target); + ((IIntrinsicR)this).Body(pauli, -angle, target); } - public virtual void R__ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target) + void IIntrinsicR.ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target) { this.CheckQubits(controls, target); CheckAngle(angle); SafeControlled(controls, - () => R__Body(pauli, angle, target), + () => ((IIntrinsicR)this).Body(pauli, angle, target), (count, ids) => MCR(this.Id, pauli, angle, count, ids, (uint)target.Id)); } - public virtual void R__ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target) + void IIntrinsicR.ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target) { - R__ControlledBody(controls, pauli, -angle, target); + ((IIntrinsicR)this).ControlledBody(controls, pauli, -angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/Random.cs b/src/Simulation/Simulators/QuantumSimulator/Random.cs deleted file mode 100644 index 073e9e2ab92..00000000000 --- a/src/Simulation/Simulators/QuantumSimulator/Random.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Microsoft.Quantum.Simulation.Core; - -namespace Microsoft.Quantum.Simulation.Simulators -{ - public partial class QuantumSimulator - { - public class QSimrandom : Quantum.Intrinsic.Random - { - private uint SimulatorId { get; } - - public QSimrandom(QuantumSimulator m) : base(m) - { - this.SimulatorId = m.Id; - } - - public override Func, Int64> __Body__ => (p) => - { - return random_choice(this.SimulatorId, p.Length, p.ToArray()); - }; - } - } -} diff --git a/src/Simulation/Simulators/QuantumSimulator/Reset.cs b/src/Simulation/Simulators/QuantumSimulator/Reset.cs index 7a52215b8ec..a8bce353976 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Reset.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Reset.cs @@ -2,12 +2,13 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public void Reset__Body(Qubit target) + void IIntrinsicReset.Body(Qubit target) { // The native simulator doesn't have a reset operation, so simulate // it via an M follow by a conditional X. diff --git a/src/Simulation/Simulators/QuantumSimulator/Rx.cs b/src/Simulation/Simulators/QuantumSimulator/Rx.cs index 547ca6e0146..32f65bd2d82 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Rx.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Rx.cs @@ -2,33 +2,34 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Rx__Body(double angle, Qubit target) + void IIntrinsicRx.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliX, angle, (uint)target.Id); } - public virtual void Rx__AdjointBody(double angle, Qubit target) + void IIntrinsicRx.AdjointBody(double angle, Qubit target) { - Rx__Body(-angle, target); + ((IIntrinsicRx)this).Body(-angle, target); } - public virtual void Rx__ControlledBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRx.ControlledBody(IQArray controls, double angle, Qubit target) { this.CheckQubits(controls, target); CheckAngle(angle); MCR(this.Id, Pauli.PauliX, angle, (uint)controls.Length, controls.GetIds(), (uint)target.Id); } - public virtual void Rx__ControlledAdjointBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRx.ControlledAdjointBody(IQArray controls, double angle, Qubit target) { - Rx__ControlledBody(controls, -angle, target); + ((IIntrinsicRx)this).ControlledBody(controls, -angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/Ry.cs b/src/Simulation/Simulators/QuantumSimulator/Ry.cs index 9813e2d15b4..b76cca3ec86 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Ry.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Ry.cs @@ -2,33 +2,34 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Ry__Body(double angle, Qubit target) + void IIntrinsicRy.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliY, angle, (uint)target.Id); } - public virtual void Ry__AdjointBody(double angle, Qubit target) + void IIntrinsicRy.AdjointBody(double angle, Qubit target) { - Ry__Body(-angle, target); + ((IIntrinsicRy)this).Body(-angle, target); } - public virtual void Ry__ControlledBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRy.ControlledBody(IQArray controls, double angle, Qubit target) { this.CheckQubits(controls, target); CheckAngle(angle); MCR(this.Id, Pauli.PauliY, angle, (uint)controls.Length, controls.GetIds(), (uint)target.Id); } - public virtual void Ry__ControlledAdjointBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRy.ControlledAdjointBody(IQArray controls, double angle, Qubit target) { - Ry__ControlledBody(controls, -angle, target); + ((IIntrinsicRy)this).ControlledBody(controls, -angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/Rz.cs b/src/Simulation/Simulators/QuantumSimulator/Rz.cs index d3e052d88d0..8f0b259ca95 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Rz.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Rz.cs @@ -2,33 +2,34 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Rz__Body(double angle, Qubit target) + void IIntrinsicRz.Body(double angle, Qubit target) { this.CheckQubit(target, nameof(target)); CheckAngle(angle); R(this.Id, Pauli.PauliZ, angle, (uint)target.Id); } - public virtual void Rz__AdjointBody(double angle, Qubit target) + void IIntrinsicRz.AdjointBody(double angle, Qubit target) { - Rz__Body(-angle, target); + ((IIntrinsicRz)this).Body(-angle, target); } - public virtual void Rz__ControlledBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRz.ControlledBody(IQArray controls, double angle, Qubit target) { this.CheckQubits(controls, target); CheckAngle(angle); MCR(this.Id, Pauli.PauliZ, angle, (uint)controls.Length, controls.GetIds(), (uint)target.Id); } - public virtual void Rz__ControlledAdjointBody(IQArray controls, double angle, Qubit target) + void IIntrinsicRz.ControlledAdjointBody(IQArray controls, double angle, Qubit target) { - Rz__ControlledBody(controls, -angle, target); + ((IIntrinsicRz)this).ControlledBody(controls, -angle, target); } } } diff --git a/src/Simulation/Simulators/QuantumSimulator/S.cs b/src/Simulation/Simulators/QuantumSimulator/S.cs index 592f23a17d2..f3a06adab56 100644 --- a/src/Simulation/Simulators/QuantumSimulator/S.cs +++ b/src/Simulation/Simulators/QuantumSimulator/S.cs @@ -2,40 +2,41 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void S__Body(Qubit target) + void IIntrinsicS.Body(Qubit target) { this.CheckQubit(target); S(this.Id, (uint)target.Id); } - public virtual void S__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicS.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => S__Body(target), + () => ((IIntrinsicS)this).Body(target), (count, ids) => MCS(this.Id, count, ids, (uint)target.Id)); } - public virtual void S__AdjointBody(Qubit target) + void IIntrinsicS.AdjointBody(Qubit target) { this.CheckQubit(target); AdjS(this.Id, (uint)target.Id); } - public virtual void S__ControlledAdjointBody(IQArray controls, Qubit target) + void IIntrinsicS.ControlledAdjointBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => S__AdjointBody(target), + () => ((IIntrinsicS)this).AdjointBody(target), (count, ids) => MCAdjS(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/QuantumSimulator/SWAP.cs b/src/Simulation/Simulators/QuantumSimulator/SWAP.cs index b3cc0597e1e..b0be124a3b7 100644 --- a/src/Simulation/Simulators/QuantumSimulator/SWAP.cs +++ b/src/Simulation/Simulators/QuantumSimulator/SWAP.cs @@ -2,13 +2,14 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void SWAP__Body(Qubit target1, Qubit target2) + void IIntrinsicSWAP.Body(Qubit target1, Qubit target2) { var ctrls1 = new QArray(target1); var ctrls2 = new QArray(target2); @@ -19,11 +20,11 @@ public virtual void SWAP__Body(Qubit target1, Qubit target2) MCX(this.Id, (uint)ctrls1.Length, ctrls1.GetIds(), (uint)target2.Id); } - public virtual void SWAP__ControlledBody(IQArray controls, Qubit target1, Qubit target2) + void IIntrinsicSWAP.ControlledBody(IQArray controls, Qubit target1, Qubit target2) { if ((controls == null) || (controls.Count == 0)) { - SWAP__Body(target1, target2); + ((IIntrinsicSWAP)this).Body(target1, target2); } else { diff --git a/src/Simulation/Simulators/QuantumSimulator/T.cs b/src/Simulation/Simulators/QuantumSimulator/T.cs index 8e8e5d364a1..25ca2f61d48 100644 --- a/src/Simulation/Simulators/QuantumSimulator/T.cs +++ b/src/Simulation/Simulators/QuantumSimulator/T.cs @@ -2,40 +2,41 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void T__Body(Qubit target) + void IIntrinsicT.Body(Qubit target) { this.CheckQubit(target); T(this.Id, (uint)target.Id); } - public virtual void T__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicT.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => T__Body(target), + () => ((IIntrinsicT)this).Body(target), (count, ids) => MCT(this.Id, count, ids, (uint)target.Id)); } - public virtual void T__AdjointBody(Qubit target) + void IIntrinsicT.AdjointBody(Qubit target) { this.CheckQubit(target); AdjT(this.Id, (uint)target.Id); } - public virtual void T__ControlledAdjointBody(IQArray controls, Qubit target) + void IIntrinsicT.ControlledAdjointBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => T__AdjointBody(target), + () => ((IIntrinsicT)this).AdjointBody(target), (count, ids) => MCAdjT(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/QuantumSimulator/X.cs b/src/Simulation/Simulators/QuantumSimulator/X.cs index 3ea6d275b5e..7af68a2b261 100644 --- a/src/Simulation/Simulators/QuantumSimulator/X.cs +++ b/src/Simulation/Simulators/QuantumSimulator/X.cs @@ -2,24 +2,25 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void X__Body(Qubit target) + void IIntrinsicX.Body(Qubit target) { this.CheckQubit(target); X(this.Id, (uint)target.Id); } - public virtual void X__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicX.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => X__Body(target), + () => ((IIntrinsicX)this).Body(target), (count, ids) => MCX(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/QuantumSimulator/Y.cs b/src/Simulation/Simulators/QuantumSimulator/Y.cs index 4469dd356ea..8858b2202dd 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Y.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Y.cs @@ -2,24 +2,25 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Y__Body(Qubit target) + void IIntrinsicY.Body(Qubit target) { this.CheckQubit(target); Y(this.Id, (uint)target.Id); } - public virtual void Y__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicY.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => Y__Body(target), + () => ((IIntrinsicY)this).Body(target), (count, ids) => MCY(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/QuantumSimulator/Z.cs b/src/Simulation/Simulators/QuantumSimulator/Z.cs index efe41238a64..026f4f5c6d2 100644 --- a/src/Simulation/Simulators/QuantumSimulator/Z.cs +++ b/src/Simulation/Simulators/QuantumSimulator/Z.cs @@ -2,24 +2,25 @@ // Licensed under the MIT License. using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { public partial class QuantumSimulator { - public virtual void Z__Body(Qubit target) + void IIntrinsicZ.Body(Qubit target) { this.CheckQubit(target); Z(this.Id, (uint)target.Id); } - public virtual void Z__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicZ.ControlledBody(IQArray controls, Qubit target) { this.CheckQubits(controls, target); SafeControlled(controls, - () => Z__Body(target), + () => ((IIntrinsicZ)this).Body(target), (count, ids) => MCZ(this.Id, count, ids, (uint)target.Id)); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/Exp.cs b/src/Simulation/Simulators/ToffoliSimulator/Exp.cs index 5bd117c287e..6bead008ceb 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/Exp.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/Exp.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -13,7 +14,7 @@ public partial class ToffoliSimulator /// For the Toffoli simulator, the implementation flips a target qubit /// if the respective rotation is effectively an X gate. /// - public void Exp__Body(IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.Body(IQArray paulis, double angle, IQArray targets) { if (targets == null) return; @@ -38,7 +39,7 @@ public void Exp__Body(IQArray paulis, double angle, IQArray target /// The implementation of the adjoint specialization of the operation. /// For the Toffoli simulator *only*, this operation is self-adjoint. /// - public void Exp__AdjointBody(IQArray paulis, double angle, IQArray targets) => Exp__Body(paulis, angle, targets); + void IIntrinsicExp.AdjointBody(IQArray paulis, double angle, IQArray targets) => ((IIntrinsicExp)this).Body(paulis, angle, targets); /// /// The implementation of the controlled specialization of the operation. @@ -46,7 +47,7 @@ public void Exp__Body(IQArray paulis, double angle, IQArray target /// if the rotation is effectively an X gate and all of the control qubits /// are in the One state. /// - public void Exp__ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets) + void IIntrinsicExp.ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets) { if (targets == null) return; @@ -72,6 +73,6 @@ public void Exp__ControlledBody(IQArray controls, IQArray paulis, /// The implementation of the controlled adjoint specialization of the operation. /// For the Toffoli simulator *only*, the controlled specialization is self-adjoint. /// - public void Exp__ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets) => Exp__ControlledBody(controls, paulis, angle, targets); + void IIntrinsicExp.ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets) => ((IIntrinsicExp)this).ControlledBody(controls, paulis, angle, targets); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/H.cs b/src/Simulation/Simulators/ToffoliSimulator/H.cs index 9b9b3c45be3..184669a41bd 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/H.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/H.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,8 +13,8 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation throws a run-time error. /// - public void H__Body(Qubit target) => throw new NotImplementedException(); + void IIntrinsicH.Body(Qubit target) => throw new NotImplementedException(); - public void H__ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicH.ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/Measure.cs b/src/Simulation/Simulators/ToffoliSimulator/Measure.cs index 5ed771006ff..886626d3213 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/Measure.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/Measure.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -16,7 +17,7 @@ public partial class ToffoliSimulator /// That is, Result.One is returned if an odd number of the measured qubits are /// in the One state. /// - public Result Measure__Body(IQArray paulis, IQArray targets) + Result IIntrinsicMeasure.Body(IQArray paulis, IQArray targets) { Qubit? f(Pauli p, Qubit q) => p switch { diff --git a/src/Simulation/Simulators/ToffoliSimulator/R.cs b/src/Simulation/Simulators/ToffoliSimulator/R.cs index 7c1fdd33d4e..b3960bb89c5 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/R.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/R.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -13,7 +14,7 @@ public partial class ToffoliSimulator /// For the Toffoli simulator, the implementation flips the target qubit /// if the rotation is effectively an X gate. /// - public void R__Body(Pauli pauli, double angle, Qubit target) + void IIntrinsicR.Body(Pauli pauli, double angle, Qubit target) { if (target == null) return; @@ -30,7 +31,7 @@ public void R__Body(Pauli pauli, double angle, Qubit target) /// The implementation of the adjoint specialization of the operation. /// For the Toffoli simulator *only*, this operation is self-adjoint. /// - public void R__AdjointBody(Pauli pauli, double angle, Qubit target) => R__Body(pauli, angle, target); + void IIntrinsicR.AdjointBody(Pauli pauli, double angle, Qubit target) => ((IIntrinsicR)this).Body(pauli, angle, target); /// /// The implementation of the controlled specialization of the operation. @@ -38,7 +39,7 @@ public void R__Body(Pauli pauli, double angle, Qubit target) /// if the rotation is effectively an X gate and all of the control qubits /// are in the One state. /// - public void R__ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target) + void IIntrinsicR.ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target) { if (target == null) return; @@ -56,6 +57,6 @@ public void R__ControlledBody(IQArray controls, Pauli pauli, double angle /// The implementation of the controlled adjoint specialization of the operation. /// For the Toffoli simulator *only*, the controlled specialization is self-adjoint. /// - public void R__ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target) => R__ControlledBody(controls, pauli, angle, target); + void IIntrinsicR.ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target) => ((IIntrinsicR)this).ControlledBody(controls, pauli, angle, target); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/Random.cs b/src/Simulation/Simulators/ToffoliSimulator/Random.cs deleted file mode 100644 index f1de531f998..00000000000 --- a/src/Simulation/Simulators/ToffoliSimulator/Random.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Linq; -using Microsoft.Quantum.Simulation.Common; -using Microsoft.Quantum.Simulation.Core; - -namespace Microsoft.Quantum.Simulation.Simulators -{ - public partial class ToffoliSimulator - { - /// - /// Implementation of the Random operation for the Toffoli simulator. - /// - public class ToffSimRandom : Microsoft.Quantum.Intrinsic.Random - { - private ToffoliSimulator Simulator; - - /// - /// Constructs a new operation instance. - /// - /// The simulator that this operation affects. - public ToffSimRandom(ToffoliSimulator m) : base(m) - { - Simulator = m; - } - - /// - /// The implementation of the operation. - /// - public override Func, Int64> __Body__ => (probs) => - CommonUtils.SampleDistribution(probs, Simulator.RandomGenerator.NextDouble()); - } - } -} diff --git a/src/Simulation/Simulators/ToffoliSimulator/S.cs b/src/Simulation/Simulators/ToffoliSimulator/S.cs index 77c6b2544bb..944ef6d3e5c 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/S.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/S.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,12 +13,12 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation throws a run-time error. /// - public void S__Body(Qubit target) => throw new NotImplementedException(); + void IIntrinsicS.Body(Qubit target) => throw new NotImplementedException(); - public void S__ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicS.ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); - public void S__AdjointBody(Qubit target) => throw new NotImplementedException(); + void IIntrinsicS.AdjointBody(Qubit target) => throw new NotImplementedException(); - public void S__ControlledAdjointBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicS.ControlledAdjointBody(IQArray controls, Qubit target) => throw new NotImplementedException(); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/T.cs b/src/Simulation/Simulators/ToffoliSimulator/T.cs index 208009be8b4..509f7dbc01e 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/T.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/T.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,12 +13,12 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation throws a run-time error. /// - public void T__Body(Qubit target) => throw new NotImplementedException(); + void IIntrinsicT.Body(Qubit target) => throw new NotImplementedException(); - public void T__ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicT.ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); - public void T__AdjointBody(Qubit target) => throw new NotImplementedException(); + void IIntrinsicT.AdjointBody(Qubit target) => throw new NotImplementedException(); - public void T__ControlledAdjointBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicT.ControlledAdjointBody(IQArray controls, Qubit target) => throw new NotImplementedException(); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/X.cs b/src/Simulation/Simulators/ToffoliSimulator/X.cs index cf42191160e..a4ca14c003e 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/X.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/X.cs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,7 +12,7 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation flips the target qubit. /// - public void X__Body(Qubit target) + void IIntrinsicX.Body(Qubit target) { if (target == null) return; @@ -26,7 +26,7 @@ public void X__Body(Qubit target) /// For the Toffoli simulator, the implementation flips the target qubit /// if all of the control qubits are 1. /// - public void X__ControlledBody(IQArray controls, Qubit target) + void IIntrinsicX.ControlledBody(IQArray controls, Qubit target) { if (target == null) return; diff --git a/src/Simulation/Simulators/ToffoliSimulator/Y.cs b/src/Simulation/Simulators/ToffoliSimulator/Y.cs index aee499ba6de..c548d089154 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/Y.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/Y.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,8 +13,8 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation throws a run-time error. /// - public void Y__Body(Qubit target) => throw new NotImplementedException(); + void IIntrinsicY.Body(Qubit target) => throw new NotImplementedException(); - public void Y__ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicY.ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); } } diff --git a/src/Simulation/Simulators/ToffoliSimulator/Z.cs b/src/Simulation/Simulators/ToffoliSimulator/Z.cs index 7044156fe0a..9afa0ab14a3 100644 --- a/src/Simulation/Simulators/ToffoliSimulator/Z.cs +++ b/src/Simulation/Simulators/ToffoliSimulator/Z.cs @@ -3,6 +3,7 @@ using System; using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Intrinsic.Interfaces; namespace Microsoft.Quantum.Simulation.Simulators { @@ -12,8 +13,8 @@ public partial class ToffoliSimulator /// The implementation of the operation. /// For the Toffoli simulator, the implementation throws a run-time error. /// - public void Z__Body(Qubit target) => throw new NotImplementedException(); + void IIntrinsicZ.Body(Qubit target) => throw new NotImplementedException(); - public void Z__ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); + void IIntrinsicZ.ControlledBody(IQArray controls, Qubit target) => throw new NotImplementedException(); } } diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs index ff92c2b126a..b45cc6fc6cb 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyControlledX : IOperationFactory + public interface IIntrinsicApplyControlledX : IOperationFactory { - void ApplyControlledX__Body(Qubit control, Qubit target); + void Body(Qubit control, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs index 82e30238f70..dd6ad75933b 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyControlledZ : IOperationFactory + public interface IIntrinsicApplyControlledZ : IOperationFactory { - void ApplyControlledZ__Body(Qubit control, Qubit target); + void Body(Qubit control, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs index 9f731e3dec9..3d53fcaa85b 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledH : IOperationFactory + public interface IIntrinsicApplyUncontrolledH : IOperationFactory { - void ApplyUncontrolledH__Body(Qubit target); + void Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs index 8812bda52bb..96b459de2f2 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledRx : IOperationFactory + public interface IIntrinsicApplyUncontrolledRx : IOperationFactory { - void ApplyUncontrolledRx__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void ApplyUncontrolledRx__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs index bc78be1cd1f..b529aff8745 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledRy : IOperationFactory + public interface IIntrinsicApplyUncontrolledRy : IOperationFactory { - void ApplyUncontrolledRy__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void ApplyUncontrolledRy__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs index b4bc21b06ed..105e43832fd 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledRz : IOperationFactory + public interface IIntrinsicApplyUncontrolledRz : IOperationFactory { - void ApplyUncontrolledRz__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void ApplyUncontrolledRz__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs index 87c09f35a93..7da220e5c19 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledS : IOperationFactory + public interface IIntrinsicApplyUncontrolledS : IOperationFactory { - void ApplyUncontrolledS__Body(Qubit target); + void Body(Qubit target); - void ApplyUncontrolledS__AdjointBody(Qubit target); + void AdjointBody(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs index f39033606bd..bb8d6aa87f7 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledSWAP : IOperationFactory + public interface IIntrinsicApplyUncontrolledSWAP : IOperationFactory { - void ApplyUncontrolledSWAP__Body(Qubit qubit1, Qubit qubit2); + void Body(Qubit qubit1, Qubit qubit2); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs index dd46b16a0e0..f54d4585668 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledT : IOperationFactory + public interface IIntrinsicApplyUncontrolledT : IOperationFactory { - void ApplyUncontrolledT__Body(Qubit target); + void Body(Qubit target); - void ApplyUncontrolledT__AdjointBody(Qubit target); + void AdjointBody(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs index 829d2a860ba..47676385be1 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledX : IOperationFactory + public interface IIntrinsicApplyUncontrolledX : IOperationFactory { - void ApplyUncontrolledX__Body(Qubit target); + void Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs index ad963c880c5..e838c812409 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledY : IOperationFactory + public interface IIntrinsicApplyUncontrolledY : IOperationFactory { - void ApplyUncontrolledY__Body(Qubit target); + void Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs index a147edd306a..130d50a755e 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_ApplyUncontrolledZ : IOperationFactory + public interface IIntrinsicApplyUncontrolledZ : IOperationFactory { - void ApplyUncontrolledZ__Body(Qubit target); + void Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs index 2161395ce4f..b2f248ddea3 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Exp : IOperationFactory + public interface IIntrinsicExp : IOperationFactory { - void Exp__Body(IQArray paulis, double angle, IQArray targets); + void Body(IQArray paulis, double angle, IQArray targets); - void Exp__AdjointBody(IQArray paulis, double angle, IQArray targets); + void AdjointBody(IQArray paulis, double angle, IQArray targets); - void Exp__ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets); + void ControlledBody(IQArray controls, IQArray paulis, double angle, IQArray targets); - void Exp__ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets); + void ControlledAdjointBody(IQArray controls, IQArray paulis, double angle, IQArray targets); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs index 94fa8055444..69c31d58538 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_H : IOperationFactory + public interface IIntrinsicH : IOperationFactory { - void H__Body(Qubit target); + void Body(Qubit target); - void H__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs index 57ad1f6e534..ab75fc70631 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_IsingXX : IOperationFactory + public interface IIntrinsicIsingXX : IOperationFactory { - void IsingXX__Body(double angle, Qubit target1, Qubit target2); + void Body(double angle, Qubit target1, Qubit target2); - void IsingXX__AdjointBody(double angle, Qubit target1, Qubit target2); + void AdjointBody(double angle, Qubit target1, Qubit target2); - void IsingXX__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); - void IsingXX__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs index b6b44c917bc..925cd2ff85d 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_IsingYY : IOperationFactory + public interface IIntrinsicIsingYY : IOperationFactory { - void IsingYY__Body(double angle, Qubit target1, Qubit target2); + void Body(double angle, Qubit target1, Qubit target2); - void IsingYY__AdjointBody(double angle, Qubit target1, Qubit target2); + void AdjointBody(double angle, Qubit target1, Qubit target2); - void IsingYY__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); - void IsingYY__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs index 3d8121676e8..b7596ae74f8 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_IsingZZ : IOperationFactory + public interface IIntrinsicIsingZZ : IOperationFactory { - void IsingZZ__Body(double angle, Qubit target1, Qubit target2); + void Body(double angle, Qubit target1, Qubit target2); - void IsingZZ__AdjointBody(double angle, Qubit target1, Qubit target2); + void AdjointBody(double angle, Qubit target1, Qubit target2); - void IsingZZ__ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledBody(IQArray controls, double angle, Qubit target1, Qubit target2); - void IsingZZ__ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target1, Qubit target2); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs index 2b3dcef9785..9ca0649b202 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_M : IOperationFactory + public interface IIntrinsicM : IOperationFactory { - Result M__Body(Qubit target); + Result Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs index f463a2f4152..e37209415b4 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Measure : IOperationFactory + public interface IIntrinsicMeasure : IOperationFactory { - Result Measure__Body(IQArray paulis, IQArray targets); + Result Body(IQArray paulis, IQArray targets); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs index f9a1edb0286..2e64412edcb 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_R : IOperationFactory + public interface IIntrinsicR : IOperationFactory { - void R__Body(Pauli pauli, double angle, Qubit target); + void Body(Pauli pauli, double angle, Qubit target); - void R__AdjointBody(Pauli pauli, double angle, Qubit target); + void AdjointBody(Pauli pauli, double angle, Qubit target); - void R__ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target); + void ControlledBody(IQArray controls, Pauli pauli, double angle, Qubit target); - void R__ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target); + void ControlledAdjointBody(IQArray controls, Pauli pauli, double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs index 9d173078257..44630470955 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs @@ -5,8 +5,8 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Reset : IOperationFactory + public interface IIntrinsicReset : IOperationFactory { - void Reset__Body(Qubit target); + void Body(Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs index 8dc38c529eb..c71b59eb55b 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Rx : IOperationFactory + public interface IIntrinsicRx : IOperationFactory { - void Rx__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void Rx__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); - void Rx__ControlledBody(IQArray controls, double angle, Qubit target); + void ControlledBody(IQArray controls, double angle, Qubit target); - void Rx__ControlledAdjointBody(IQArray controls, double angle, Qubit target); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs index 151f2ab9f1a..847e47022f9 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Ry : IOperationFactory + public interface IIntrinsicRy : IOperationFactory { - void Ry__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void Ry__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); - void Ry__ControlledBody(IQArray controls, double angle, Qubit target); + void ControlledBody(IQArray controls, double angle, Qubit target); - void Ry__ControlledAdjointBody(IQArray controls, double angle, Qubit target); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs index 3b4a950a765..55d2edc987e 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Rz : IOperationFactory + public interface IIntrinsicRz : IOperationFactory { - void Rz__Body(double angle, Qubit target); + void Body(double angle, Qubit target); - void Rz__AdjointBody(double angle, Qubit target); + void AdjointBody(double angle, Qubit target); - void Rz__ControlledBody(IQArray controls, double angle, Qubit target); + void ControlledBody(IQArray controls, double angle, Qubit target); - void Rz__ControlledAdjointBody(IQArray controls, double angle, Qubit target); + void ControlledAdjointBody(IQArray controls, double angle, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs index e6b15312f36..89210374a33 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_S : IOperationFactory + public interface IIntrinsicS : IOperationFactory { - void S__Body(Qubit target); + void Body(Qubit target); - void S__AdjointBody(Qubit target); + void AdjointBody(Qubit target); - void S__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); - void S__ControlledAdjointBody(IQArray controls, Qubit target); + void ControlledAdjointBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs index a987d1bcf3b..4532936adcd 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs @@ -6,10 +6,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_SWAP : IOperationFactory + public interface IIntrinsicSWAP : IOperationFactory { - void SWAP__Body(Qubit target1, Qubit target2); + void Body(Qubit target1, Qubit target2); - void SWAP__ControlledBody(IQArray controls, Qubit target1, Qubit target2); + void ControlledBody(IQArray controls, Qubit target1, Qubit target2); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs index 76030a713e3..16998337cb5 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs @@ -5,14 +5,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_T : IOperationFactory + public interface IIntrinsicT : IOperationFactory { - void T__Body(Qubit target); + void Body(Qubit target); - void T__AdjointBody(Qubit target); + void AdjointBody(Qubit target); - void T__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); - void T__ControlledAdjointBody(IQArray controls, Qubit target); + void ControlledAdjointBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs index 8b2337e9baa..577fcc0a97f 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_X : IOperationFactory + public interface IIntrinsicX : IOperationFactory { - void X__Body(Qubit target); + void Body(Qubit target); - void X__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs index f77737c3816..7687d34fa30 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Y : IOperationFactory + public interface IIntrinsicY : IOperationFactory { - void Y__Body(Qubit target); + void Body(Qubit target); - void Y__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs b/src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs index d312415eb64..0cd14cc7396 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs @@ -5,10 +5,10 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { - public interface IGate_Z : IOperationFactory + public interface IIntrinsicZ : IOperationFactory { - void Z__Body(Qubit target); + void Body(Qubit target); - void Z__ControlledBody(IQArray controls, Qubit target); + void ControlledBody(IQArray controls, Qubit target); } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IQSharpCore.cs b/src/Simulation/TargetDefinitions/Interfaces/IQSharpCore.cs index 6c47d4dd93e..230536babe0 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IQSharpCore.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IQSharpCore.cs @@ -4,14 +4,14 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { public interface IQSharpCore : - IGate_Exp, - IGate_H, - IGate_Measure, - IGate_R, - IGate_S, - IGate_T, - IGate_X, - IGate_Y, - IGate_Z + IIntrinsicExp, + IIntrinsicH, + IIntrinsicMeasure, + IIntrinsicR, + IIntrinsicS, + IIntrinsicT, + IIntrinsicX, + IIntrinsicY, + IIntrinsicZ { } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IType1Core.cs b/src/Simulation/TargetDefinitions/Interfaces/IType1Core.cs index fbf02b06a45..23ec062a98b 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IType1Core.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IType1Core.cs @@ -4,18 +4,18 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { public interface IType1Core : - IGate_ApplyControlledX, - IGate_ApplyControlledZ, - IGate_ApplyUncontrolledH, - IGate_ApplyUncontrolledRx, - IGate_ApplyUncontrolledRy, - IGate_ApplyUncontrolledRz, - IGate_ApplyUncontrolledS, - IGate_ApplyUncontrolledT, - IGate_ApplyUncontrolledX, - IGate_ApplyUncontrolledY, - IGate_ApplyUncontrolledZ, - IGate_M, - IGate_Reset + IIntrinsicApplyControlledX, + IIntrinsicApplyControlledZ, + IIntrinsicApplyUncontrolledH, + IIntrinsicApplyUncontrolledRx, + IIntrinsicApplyUncontrolledRy, + IIntrinsicApplyUncontrolledRz, + IIntrinsicApplyUncontrolledS, + IIntrinsicApplyUncontrolledT, + IIntrinsicApplyUncontrolledX, + IIntrinsicApplyUncontrolledY, + IIntrinsicApplyUncontrolledZ, + IIntrinsicM, + IIntrinsicReset { } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IType2Core.cs b/src/Simulation/TargetDefinitions/Interfaces/IType2Core.cs index 3603389e9f4..24ec4127be6 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IType2Core.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IType2Core.cs @@ -4,19 +4,19 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { public interface IType2Core : - IGate_H, - IGate_IsingXX, - IGate_IsingYY, - IGate_IsingZZ, - IGate_M, - IGate_Rx, - IGate_Ry, - IGate_Rz, - IGate_S, - IGate_SWAP, - IGate_T, - IGate_X, - IGate_Y, - IGate_Z + IIntrinsicH, + IIntrinsicIsingXX, + IIntrinsicIsingYY, + IIntrinsicIsingZZ, + IIntrinsicM, + IIntrinsicRx, + IIntrinsicRy, + IIntrinsicRz, + IIntrinsicS, + IIntrinsicSWAP, + IIntrinsicT, + IIntrinsicX, + IIntrinsicY, + IIntrinsicZ { } } \ No newline at end of file diff --git a/src/Simulation/TargetDefinitions/Interfaces/IType3Core.cs b/src/Simulation/TargetDefinitions/Interfaces/IType3Core.cs index 9c34efb953e..fb79a8894c6 100644 --- a/src/Simulation/TargetDefinitions/Interfaces/IType3Core.cs +++ b/src/Simulation/TargetDefinitions/Interfaces/IType3Core.cs @@ -4,19 +4,19 @@ namespace Microsoft.Quantum.Intrinsic.Interfaces { public interface IType3Core : - IGate_ApplyControlledX, - IGate_ApplyControlledZ, - IGate_ApplyUncontrolledH, - IGate_ApplyUncontrolledRx, - IGate_ApplyUncontrolledRy, - IGate_ApplyUncontrolledRz, - IGate_ApplyUncontrolledS, - IGate_ApplyUncontrolledSWAP, - IGate_ApplyUncontrolledT, - IGate_ApplyUncontrolledX, - IGate_ApplyUncontrolledY, - IGate_ApplyUncontrolledZ, - IGate_M, - IGate_Reset + IIntrinsicApplyControlledX, + IIntrinsicApplyControlledZ, + IIntrinsicApplyUncontrolledH, + IIntrinsicApplyUncontrolledRx, + IIntrinsicApplyUncontrolledRy, + IIntrinsicApplyUncontrolledRz, + IIntrinsicApplyUncontrolledS, + IIntrinsicApplyUncontrolledSWAP, + IIntrinsicApplyUncontrolledT, + IIntrinsicApplyUncontrolledX, + IIntrinsicApplyUncontrolledY, + IIntrinsicApplyUncontrolledZ, + IIntrinsicM, + IIntrinsicReset { } } \ No newline at end of file From d8c8e6cf655a8bb394d5b77aa98ca61de2172744 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Sat, 27 Feb 2021 13:26:03 -0800 Subject: [PATCH 2/3] Rename interface files --- .../{IGate_ApplyControlledX.cs => IIntrinsicApplyControlledX.cs} | 0 .../{IGate_ApplyControlledZ.cs => IIntrinsicApplyControlledZ.cs} | 0 ...Gate_ApplyUncontrolledH.cs => IIntrinsicApplyUncontrolledH.cs} | 0 ...te_ApplyUncontrolledRx.cs => IIntrinsicApplyUncontrolledRx.cs} | 0 ...te_ApplyUncontrolledRy.cs => IIntrinsicApplyUncontrolledRy.cs} | 0 ...te_ApplyUncontrolledRz.cs => IIntrinsicApplyUncontrolledRz.cs} | 0 ...Gate_ApplyUncontrolledS.cs => IIntrinsicApplyUncontrolledS.cs} | 0 ...pplyUncontrolledSWAP.cs => IIntrinsicApplyUncontrolledSWAP.cs} | 0 ...Gate_ApplyUncontrolledT.cs => IIntrinsicApplyUncontrolledT.cs} | 0 ...Gate_ApplyUncontrolledX.cs => IIntrinsicApplyUncontrolledX.cs} | 0 ...Gate_ApplyUncontrolledY.cs => IIntrinsicApplyUncontrolledY.cs} | 0 ...Gate_ApplyUncontrolledZ.cs => IIntrinsicApplyUncontrolledZ.cs} | 0 .../Interfaces/{IGate_Exp.cs => IIntrinsicExp.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_H.cs => IIntrinsicH.cs} | 0 .../Interfaces/{IGate_IsingXX.cs => IIntrinsicIsingXX.cs} | 0 .../Interfaces/{IGate_IsingYY.cs => IIntrinsicIsingYY.cs} | 0 .../Interfaces/{IGate_IsingZZ.cs => IIntrinsicIsingZZ.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_M.cs => IIntrinsicM.cs} | 0 .../Interfaces/{IGate_Measure.cs => IIntrinsicMeasure.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_R.cs => IIntrinsicR.cs} | 0 .../Interfaces/{IGate_Reset.cs => IIntrinsicReset.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_Rx.cs => IIntrinsicRx.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_Ry.cs => IIntrinsicRy.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_Rz.cs => IIntrinsicRz.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_S.cs => IIntrinsicS.cs} | 0 .../Interfaces/{IGate_SWAP.cs => IIntrinsicSWAP.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_T.cs => IIntrinsicT.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_X.cs => IIntrinsicX.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_Y.cs => IIntrinsicY.cs} | 0 .../TargetDefinitions/Interfaces/{IGate_Z.cs => IIntrinsicZ.cs} | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyControlledX.cs => IIntrinsicApplyControlledX.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyControlledZ.cs => IIntrinsicApplyControlledZ.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledH.cs => IIntrinsicApplyUncontrolledH.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledRx.cs => IIntrinsicApplyUncontrolledRx.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledRy.cs => IIntrinsicApplyUncontrolledRy.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledRz.cs => IIntrinsicApplyUncontrolledRz.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledS.cs => IIntrinsicApplyUncontrolledS.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledSWAP.cs => IIntrinsicApplyUncontrolledSWAP.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledT.cs => IIntrinsicApplyUncontrolledT.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledX.cs => IIntrinsicApplyUncontrolledX.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledY.cs => IIntrinsicApplyUncontrolledY.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_ApplyUncontrolledZ.cs => IIntrinsicApplyUncontrolledZ.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Exp.cs => IIntrinsicExp.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_H.cs => IIntrinsicH.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_IsingXX.cs => IIntrinsicIsingXX.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_IsingYY.cs => IIntrinsicIsingYY.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_IsingZZ.cs => IIntrinsicIsingZZ.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_M.cs => IIntrinsicM.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Measure.cs => IIntrinsicMeasure.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_R.cs => IIntrinsicR.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Reset.cs => IIntrinsicReset.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Rx.cs => IIntrinsicRx.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Ry.cs => IIntrinsicRy.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Rz.cs => IIntrinsicRz.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_S.cs => IIntrinsicS.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_SWAP.cs => IIntrinsicSWAP.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_T.cs => IIntrinsicT.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_X.cs => IIntrinsicX.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Y.cs => IIntrinsicY.cs} (100%) rename src/Simulation/TargetDefinitions/Interfaces/{IGate_Z.cs => IIntrinsicZ.cs} (100%) diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyControlledX.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledX.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyControlledX.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyControlledZ.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyControlledZ.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyControlledZ.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledH.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledH.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledH.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRx.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRx.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRx.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRy.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRy.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRy.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRz.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledRz.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledRz.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledS.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledS.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledS.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledSWAP.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledSWAP.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledSWAP.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledT.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledT.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledT.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledX.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledX.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledX.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledY.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledY.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledY.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledZ.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_ApplyUncontrolledZ.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicApplyUncontrolledZ.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicExp.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Exp.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicExp.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicH.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_H.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicH.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingXX.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_IsingXX.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingXX.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingYY.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_IsingYY.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingYY.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingZZ.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_IsingZZ.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicIsingZZ.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicM.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_M.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicM.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicMeasure.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Measure.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicMeasure.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicR.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_R.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicR.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicReset.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Reset.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicReset.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRx.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Rx.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRx.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRy.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Ry.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRy.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRz.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Rz.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicRz.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicS.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_S.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicS.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicSWAP.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_SWAP.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicSWAP.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicT.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_T.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicT.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicX.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_X.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicX.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicY.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Y.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicY.cs diff --git a/src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs b/src/Simulation/TargetDefinitions/Interfaces/IIntrinsicZ.cs similarity index 100% rename from src/Simulation/TargetDefinitions/Interfaces/IGate_Z.cs rename to src/Simulation/TargetDefinitions/Interfaces/IIntrinsicZ.cs From ac2228e491f8887badd32a16abed27861f4622b1 Mon Sep 17 00:00:00 2001 From: "Stefan J. Wernli" Date: Fri, 12 Mar 2021 09:17:39 -0800 Subject: [PATCH 3/3] Remove class nesting to avoid breaking change. --- src/Simulation/QSharpCore/Intrinsic.cs | 119 ++++++++++++------------- 1 file changed, 58 insertions(+), 61 deletions(-) diff --git a/src/Simulation/QSharpCore/Intrinsic.cs b/src/Simulation/QSharpCore/Intrinsic.cs index bbc9740fab5..5eef2861ed7 100644 --- a/src/Simulation/QSharpCore/Intrinsic.cs +++ b/src/Simulation/QSharpCore/Intrinsic.cs @@ -89,114 +89,111 @@ public partial class ResetAll } } - public class QSimLegacy + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimExp : Exp { - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimExp : Exp + public QSimExp(IOperationFactory factory) : base(factory) { - public QSimExp(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimExpFrac : ExpFrac + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimExpFrac : ExpFrac + { + public QSimExpFrac(IOperationFactory factory) : base(factory) { - public QSimExpFrac(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimH : H + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimH : H + { + public QSimH(IOperationFactory factory) : base(factory) { - public QSimH(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimM : M + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimM : M + { + public QSimM(IOperationFactory factory) : base(factory) { - public QSimM(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimMeasure : Measure + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimMeasure : Measure + { + public QSimMeasure(IOperationFactory factory) : base(factory) { - public QSimMeasure(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimR : R + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimR : R + { + public QSimR(IOperationFactory factory) : base(factory) { - public QSimR(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimRFrac : RFrac + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimRFrac : RFrac + { + public QSimRFrac(IOperationFactory factory) : base(factory) { - public QSimRFrac(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimS : S + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimS : S + { + public QSimS(IOperationFactory factory) : base(factory) { - public QSimS(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimT : T + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimT : T + { + public QSimT(IOperationFactory factory) : base(factory) { - public QSimT(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimX : X + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimX : X + { + public QSimX(IOperationFactory factory) : base(factory) { - public QSimX(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimY : Y + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimY : Y + { + public QSimY(IOperationFactory factory) : base(factory) { - public QSimY(IOperationFactory factory) : base(factory) - { - } } + } - [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] - public class QSimZ : Z + [Obsolete("This class is deprecated and will be removed in a future release. Considering using the corresponding callable class from 'Microsoft.Quantum.Intrinsic' directly.")] + public class QSimZ : Z + { + public QSimZ(IOperationFactory factory) : base(factory) { - public QSimZ(IOperationFactory factory) : base(factory) - { - } } } }