qfnn.qf_fb.q_input module

class qfnn.qf_fb.q_input.UMatrixCircuit(n_qubits, n_repeats)

Bases: qfnn.qf_circ.base.BaseCircuit

UMatrixCircuit is a class, which encodes unitary matrix into qubits using UnitaryGate

Parameters
  • n_qubits – input qubits of each unit

  • n_repeats – repeat times of each unit

add_input_qubits(circuit)

Function add_input_qubits is to add a group of qubits as input qubit .

Parameters
  • circuit – The circuit that you add the unit at the end

  • name – The name of the group

Returns

The register of qubits

Return type

qubits

forward(circuit, input_qubits, data_matrix, ids=None)

Function forward is to add a circuit unit to the input qubits.

Parameters

circuit – The circuit that you add the unit at the end