GeneticUseCase
public struct GeneticUseCase
A genetic algorithm looks for a quantum circuit that includes a Gate.oracle(truthTable:target:controls:)
and solves a list of GeneticUseCase instances. Each GeneticUseCase defines the expected output for the circuit
when its qubits are set to a given input and the oracle gate is initialized with a particular truthTable
-
Errors throwed by
See moreGeneticUseCase.Circuit.init(input:output:)Declaration
Swift
public enum InitError : Error
-
A
See moreGeneticUseCaseprovides enough data to configure a circuit as well as the oracle gate inside the circuit.TruthTableprovides the data for the latterDeclaration
Swift
public struct TruthTable -
A
See moreGeneticUseCaseprovides enough data to configure a circuit as well as the oracle gate inside the circuit.Circuitprovides the data for the formerDeclaration
Swift
public struct Circuit
-
Data to configure the oracle gate inside the circuit
Declaration
Swift
public let truthTable: TruthTable -
Data to configure a circuit
Declaration
Swift
public let circuit: Circuit
-
Initializes a
GeneticUseCaseinstance.Throws
Declaration
Swift
public init(truthTable: [String], circuitInput: String? = nil, circuitOutput: String) throwsParameters
truthTableList of qubit combinations for which the
controlin aGate.controlledNot(target:control:)is activated.circuitInput0’s and 1’s that set the values of the qubits before applying any quantum gate. If not input is provided, qubits are set to 0.
circuitOutput0’s and 1’s that specify the expected values of the qubits once the quantum gates are applied.
Return Value
A
GeneticUseCaseinstance. -
Initializes a
GeneticUseCaseinstance.Throws
Declaration
Swift
public init(emptyTruthTableQubitCount: Int, circuitInput: String? = nil, circuitOutput: String) throwsParameters
emptyTruthTableQubitCountAn oracle gate with an empty truth table never activates the
controlin aGate.controlledNot(target:control:), so thetargetnever changes. However, it is still necessary to specify how many qubits the truth table handles.circuitInput0’s and 1’s that set the values of the qubits before applying any quantum gate. If not input is provided, qubits are set to 0.
circuitOutput0’s and 1’s that specify the expected values of the qubits once the quantum gates are applied.
Return Value
A
GeneticUseCaseinstance.
GeneticUseCase Structure Reference