<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _to_linear(M, N, L, q):
    "Converts a qubit in chimera coordinates to its linear index."
    (x, y, u, k) = q
    return 2 * L * N * x + 2 * L * y + L * u + k