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

Commit f307ab5

Browse files
committed
update RegisterPrimitiveOperationsGivenAsCircuits
1 parent 3b34c43 commit f307ab5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Simulation/Simulators/QCTraceSimulator/QCTraceSimulatorImpl.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,24 @@ protected virtual void InitializeQCTracerCoreListeners(IList<IQCTraceSimulatorLi
148148

149149
private void RegisterPrimitiveOperationsGivenAsCircuits()
150150
{
151-
IEnumerable<Type> primitiveOperationTypes =
152-
from op in typeof(Intrinsic.X).Assembly.GetExportedTypes()
151+
var dllAssembly = typeof(Intrinsic.X).Assembly;
152+
var localAssembly = typeof(Intrinsic.ExpFrac).Assembly;
153+
154+
IEnumerable<Type> primitiveOperationTypes =
155+
from op in dllAssembly.GetExportedTypes()
153156
where op.IsSubclassOf(typeof(AbstractCallable))
154157
select op;
155158

159+
if (dllAssembly.FullName != localAssembly.FullName)
160+
{
161+
var localPrimatives =
162+
from op in localAssembly.GetExportedTypes()
163+
where op.IsSubclassOf(typeof(AbstractCallable))
164+
select op;
165+
166+
primitiveOperationTypes = primitiveOperationTypes.Concat(localPrimatives);
167+
}
168+
156169
IEnumerable<Type> primitiveOperationAsCircuits =
157170
from op in typeof(Circuits.X).Assembly.GetExportedTypes()
158171
where op.IsSubclassOf(typeof(AbstractCallable))

0 commit comments

Comments
 (0)