openfermion.transforms.weight_one_segment_code

Weight-1 segment code (arXiv:1712.07067). Outputs a 3-mode, 2-qubit

code, which encodes all the vectors (states) with Hamming weight (occupation) 0 and 1. n_qubits = 2, n_modes = 3. A linear amount of qubits can be saved appending several instances of this code.

Note:

This code is highly non-linear and might produce a lot of terms.

Returns (BinaryCode): weight one segment code