Flip-Flop Quantum RAM¶
This module implements the state preparation scheme called FFQRAM see https://arxiv.org/abs/1901.02362.
Each DB has entries that are created by controlled rotations. The final step is a measurement to cancel out the wrong branch. This makes the algorithm probabilistic in its nature.
- class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramEntry[source]¶
Bases:
objectAn DB entry of the FF QRAM scheme
- get_bits(bin_length=None)[source]¶
Get the binary bit representation of data and label for state basis identification
- Return type
str- Returns
a bit array
- add_to_circuit(qc, bus, register)[source]¶
This method adds the gates to encode this entry into the circuit :type qc:
FFQramEntry:param qc: quantum circuit to apply the entry to :type bus:QuantumCircuit:param bus: the registers for the bus :type register:Union[QuantumRegister,list] :param register: the target register for the amplitude :rtype:QuantumCircuit:return: the applied circuit
- class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramDb(iterable=(), /)[source]¶
Bases:
List[dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramEntry]The DB object with methods to create circuits
- bus_size()[source]¶
From all entries get the maximum needed bus size
- Return type
int- Returns
the bus size for the DB
- add_to_circuit(qc, bus, register)[source]¶
Add the DB to the circuit.
- Parameters
qc (
FFQramDb) – the quantum circuitbus (
QuantumCircuit) – the bus registerregister (
Union[QuantumRegister,List[Qubit]]) – the target register for the amplitudes
- Return type
None- Returns
the circuit after DB being applied