pdft.circuit.select_last_n_cp_indices

pdft.circuit.select_last_n_cp_indices#

pdft.circuit.select_last_n_cp_indices(tensors, n_gates)[source]#

Return indices of the LAST n_gates compact-CP tensors in tensors.

Mirror of upstream get_*_gate_indices. Sorts by position in the list, then takes the last n_gates such indices. After training tensors may drift slightly from the exact pattern; the unit-modulus check uses a moderate tolerance to absorb that.

Parameters:
Return type:

list[int]