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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Simulation/QCTraceSimulator/DepthCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public void OnOperationEnd(object[] returnedQubitsTraceData)
OperationCallRecord caller = operationCallStack.Peek();
HashedString callerName = caller.OperationName;

caller.ReleasedQubitsAvailableTime = Max(opRec.ReleasedQubitsAvailableTime, caller.ReleasedQubitsAvailableTime );
caller.ReleasedQubitsAvailableTime = Max(opRec.ReleasedQubitsAvailableTime, caller.ReleasedQubitsAvailableTime );
caller.ReleasedQubitsAvailableTime = Max(opRec.ReleasedQubitsAvailableTime, caller.ReleasedQubitsAvailableTime);
caller.ReturnedQubitsAvailableTime = Max(opRec.ReturnedQubitsAvailableTime, caller.ReturnedQubitsAvailableTime);

double[] metrics =
StatisticsRecord(
Expand Down
1 change: 0 additions & 1 deletion src/Simulation/QCTraceSimulator/DistinctInputsChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;

namespace Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime
{
Expand Down
2 changes: 1 addition & 1 deletion src/Simulation/QCTraceSimulator/Exceptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators
namespace Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime
{
/// <summary>
/// This exception is thrown when the input to an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Text;
using System.Threading.Tasks;
using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;

namespace Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime
{
Expand Down
1 change: 0 additions & 1 deletion src/Simulation/QCTraceSimulator/QCTraceSimulatorCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Quantum.Simulation.Common;
using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;
using System.Linq;

[Serializable]
Expand Down
2 changes: 0 additions & 2 deletions src/Simulation/QCTraceSimulator/QubitMetrics.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Quantum.Simulation.Simulators.QCTraceSimulators;

namespace Microsoft.Quantum.Simulation.QCTraceSimulatorRuntime
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,32 +177,6 @@ from op in primitiveOperationAsCircuits
}
}

#region Helpers
static private (long, long) Reduce(long numerator, long denominatorPower)
{
if (numerator == 0)
{
return (0, 0);
}

if (numerator % 2 != 0)
{
return (numerator, denominatorPower);
}

long numNew = numerator;
long denomPowerNew = denominatorPower;

while (numNew % 2 == 0)
{
numNew /= 2;
denomPowerNew -= 1;
}

return (numNew, denomPowerNew);
}
#endregion

#region Primitive operations logic

private void DoPrimitiveOperation(PrimitiveOperationsGroups operation, IQArray<Qubit> target, bool invalidateConstraints = true)
Expand All @@ -228,7 +202,7 @@ private void RFrac(Pauli pauli, long numerator, long denominatorPower, Qubit tar
return; // global phase case
}

(long numNew, long denomPowerNew) = Reduce(numerator, denominatorPower);
(long numNew, long denomPowerNew) = CommonUtils.Reduce(numerator, denominatorPower);
switch (denomPowerNew)
{
case 3:
Expand Down