qfnn.qf_circ.n_lyr_circ module¶
- class qfnn.qf_circ.n_lyr_circ.N_LYR_Circ(n_qubits, n_repeats=1)¶
Bases:
qfnn.qf_circ.base.BaseCircuit
N_LYR_Circ is a class, which includes functions to build N-layer circuit(for batch normalization)
- Parameters
n_qubits – input qubits of each unit
n_repeats – repeat times of each unit
- add_norm_qubits(circuit)¶
- add_out_qubits(circuit)¶
- forward(circuit, input_qubits, norm_qubits, out_qubits, norm_flag, norm_para)¶
Function forward is to add the circuit of N-layer.
- Parameters
circuit – The circuit that you add the unit at the end
input_qubits – The register of input qubits
norm_qubits – The register of qubits that do angle-encoding.
out_qubits – The register of output qubits
norm_flag – the direction of batch normalization.
norm_para – the parameter of batch normalization encoded in the angle of qubits.