FlipFlopQuantumRam

This module implements the state preparation scheme called FFQRAM see https://arxiv.org/abs/1901.02362.

FFQramEntry

An DB entry of the FF QRAM scheme

FFQramDb

The DB object with methods to create circuits

add_vector

Add a vector to the DB.

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.

FFQramEntry

class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramEntry[source]

An DB entry of the FF QRAM scheme

FFQramDb

class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramEntry[source]

An DB entry of the FF QRAM scheme

add_vector

– autofunction:: add_vector

class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramEntry[source]

An DB entry of the FF QRAM scheme

get_bits()[source]

Get the binary bit representation of data and label for state basis identification

Returns

a bit array

bus_size()[source]

Returns needed bus size for this entry

Returns

the length

add_to_circuit(qc, bus, register)[source]

This method adds the gates to encode this entry into the circuit :param qc: quantum circuit to apply the entry to :param bus: the registers for the bus :param register: the target register for the amplitude :return: the applied circuit

class dc_qiskit_algorithms.FlipFlopQuantumRam.FFQramDb(*args, **kwds)[source]

The DB object with methods to create circuits

bus_size()[source]

From all entries get the maximum needed bus size

Returns

the bus size for the DB

add_to_circuit(qc, bus, register)[source]

Add the DB to the circuit.

Parameters
  • qc – the quantum circuit

  • bus – the bus register

  • register – the target register for the amplitudes

Returns

the circuit after DB being applied

add_entry(pa, data, label)[source]

Add an entry to the (classical representation of) the DB.

Parameters
  • pa – probability amplitude

  • data – binary representation of data

  • label – binary representation of the label

add_entry_int(pa, data, label)[source]

Add an entry to the (classical representation of) the DB.

Parameters
  • pa – probability amplitude

  • data – the integer value of the data

  • label – the integer value of the label

dc_qiskit_algorithms.FlipFlopQuantumRam.add_vector(db, vec)[source]

Add a vector to the DB. It makes sense to give an empty DB.

Parameters
  • db – The FFQRAM DB

  • vec – the vector to be added