def _compute_vector_terms(system_size):
    try:
        return _vec_terms[system_size]
    except KeyError:
        u = np.zeros(system_size)
        u[[0, (- 1)]] = (np.sqrt(2) / 2)
        v = np.zeros(system_size)
        v[1:(- 1)] = (1 / np.sqrt((system_size - 2)))
        cross_terms = (np.outer(v, u) - np.outer(u, v))
        same_terms = (np.outer(u, u) + np.outer(v, v))
        _vec_terms[system_size] = (u, v, cross_terms, same_terms)
        return (u, v, cross_terms, same_terms)
def _compute_vector_terms(system_size):
    try:
        return _vec_terms[system_size]
    except KeyError:
        u = np.zeros(system_size)
        u[[0, (- 1)]] = (np.sqrt(2) / 2)
        v = np.zeros(system_size)
        v[1:(- 1)] = (1 / np.sqrt((system_size - 2)))
        cross_terms = (np.outer(v, u) - np.outer(u, v))
        same_terms = (np.outer(u, u) + np.outer(v, v))
        _vec_terms[system_size] = (u, v, cross_terms, same_terms)
        return (u, v, cross_terms, same_terms)