Wrapper for functions or properties that should raise an error
    if tensor is unphysical.

def raise_error_if_unphysical(f):
    """
    Wrapper for functions or properties that should raise an error
    if tensor is unphysical.
    """
    def wrapper(self, *args, **kwargs):
        if self.k_vrh < 0 or self.g_vrh < 0:
            raise ValueError("Bulk or shear modulus is negative, property "
                             "cannot be determined")
        return f(self, *args, **kwargs)
    return wrapper