UnitaryConfiguration
public enum UnitaryConfiguration
Define performance and memory footprint of Circuit.unitary(withQubitCount:)
.
-
Each
Gate
is expanded into aMatrix
before applying to the unitaryMatrix
for the entire circuit. Matrix expansion is performed with up toexpansionConcurrency
threads. IfexpansionConcurrency
is 0 or less, it will be defaulted to 1. This configuration has the biggest memory footprint but it is the fastest.Declaration
Swift
case matrix(expansionConcurrency: Int = 1)
-
To apply a
Gate
to the unitaryMatrix
for the entire circuit, up tocalculationConcurrency
rows in theGate
are expanded at the same time and applied to the unitary as needed. In turn, each row will be expanded with up toexpansionConcurrency
threads, socalculationConcurrency
*expansionConcurrency
threads might be running concurrently at any given moment. IfcalculationConcurrency
orexpansionConcurrency
are set to 0 or less, they will be defaulted to 1.Declaration
Swift
case row(calculationConcurrency: Int = 1, expansionConcurrency: Int = 1)
-
To apply a
Gate
to the unitaryMatrix
for the entire circuit, up tocalculationConcurrency
values in the unitary are calculated simultaneously. Values inGate
are requested one by one and when needed. IfcalculationConcurrency
is 0 or less, it will be defaulted to 1. This configuration is the slowest but it has the smallest memory footprint.Declaration
Swift
case value(calculationConcurrency: Int = 1)