def get_primitive_matrix_by_centring(centring):
    """Return primitive matrix corresponding to centring."""
    if centring == "P":
        return [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
    elif centring == "F":
        return [[0, 1.0 / 2, 1.0 / 2], [1.0 / 2, 0, 1.0 / 2], [1.0 / 2, 1.0 / 2, 0]]
    elif centring == "I":
        return [
            [-1.0 / 2, 1.0 / 2, 1.0 / 2],
            [1.0 / 2, -1.0 / 2, 1.0 / 2],
            [1.0 / 2, 1.0 / 2, -1.0 / 2],
        ]
    elif centring == "A":
        return [[1, 0, 0], [0, 1.0 / 2, -1.0 / 2], [0, 1.0 / 2, 1.0 / 2]]
    elif centring == "C":
        return [[1.0 / 2, 1.0 / 2, 0], [-1.0 / 2, 1.0 / 2, 0], [0, 0, 1]]
    elif centring == "R":
        return [
            [2.0 / 3, -1.0 / 3, -1.0 / 3],
            [1.0 / 3, 1.0 / 3, -2.0 / 3],
            [1.0 / 3, 1.0 / 3, 1.0 / 3],
        ]
    else:
        return None