def __init__(self, domain_dim: int, ssp_dim: int=151, n_rotates: int=5, n_scales: int=5, scale_min=(((2 * np.pi) / np.sqrt(6)) - 0.5), scale_max=(((2 * np.pi) / np.sqrt(6)) + 0.5), domain_bounds=None, length_scale=1):
    if (((n_rotates == 5) & (n_scales == 5)) & (ssp_dim != 151)):
        n_rotates = int(np.max([1, np.sqrt(((ssp_dim - 1) / (2 * (domain_dim + 1))))]))
        n_scales = n_rotates
    phases_hex = np.hstack([((np.sqrt((1 + (1 / domain_dim))) * np.identity(domain_dim)) - ((domain_dim ** ((- 3) / 2)) * (np.sqrt((domain_dim + 1)) + 1))), ((domain_dim ** ((- 1) / 2)) * np.ones((domain_dim, 1)))]).T
    self.grid_basis_dim = (domain_dim + 1)
    self.num_grids = (n_rotates * n_scales)
    scales = np.linspace(scale_min, scale_max, n_scales)
    phases_scaled = np.vstack([(phases_hex * i) for i in scales])
    if (n_rotates == 1):
        phases_scaled_rotated = phases_scaled
    elif (domain_dim == 1):
        scales = np.linspace(scale_min, scale_max, (n_scales + n_rotates))
        phases_scaled_rotated = np.vstack([(phases_hex * i) for i in scales])
    elif (domain_dim == 2):
        angles = np.linspace(0, ((2 * np.pi) / 3), n_rotates)
        R_mats = np.stack([np.stack([np.cos(angles), (- np.sin(angles))], axis=1), np.stack([np.sin(angles), np.cos(angles)], axis=1)], axis=1)
        phases_scaled_rotated = (R_mats @ phases_scaled.T).transpose(0, 2, 1).reshape((- 1), domain_dim)
    else:
        R_mats = special_ortho_group.rvs(domain_dim, size=n_rotates)
        phases_scaled_rotated = (R_mats @ phases_scaled.T).transpose(0, 2, 1).reshape((- 1), domain_dim)
    axis_matrix = _constructaxisfromphases(phases_scaled_rotated)
    ssp_dim = axis_matrix.shape[0]
    super().__init__(domain_dim, ssp_dim, axis_matrix=axis_matrix, domain_bounds=domain_bounds, length_scale=length_scale)
def __init__(self, domain_dim: int, ssp_dim: int=151, n_rotates: int=5, n_scales: int=5, scale_min=(((2 * np.pi) / np.sqrt(6)) - 0.5), scale_max=(((2 * np.pi) / np.sqrt(6)) + 0.5), domain_bounds=None, length_scale=1):
    if (((n_rotates == 5) & (n_scales == 5)) & (ssp_dim != 151)):
        n_rotates = int(np.max([1, np.sqrt(((ssp_dim - 1) / (2 * (domain_dim + 1))))]))
        n_scales = n_rotates
    phases_hex = np.hstack([((np.sqrt((1 + (1 / domain_dim))) * np.identity(domain_dim)) - ((domain_dim ** ((- 3) / 2)) * (np.sqrt((domain_dim + 1)) + 1))), ((domain_dim ** ((- 1) / 2)) * np.ones((domain_dim, 1)))]).T
    self.grid_basis_dim = (domain_dim + 1)
    self.num_grids = (n_rotates * n_scales)
    scales = np.linspace(scale_min, scale_max, n_scales)
    phases_scaled = np.vstack([(phases_hex * i) for i in scales])
    if (n_rotates == 1):
        phases_scaled_rotated = phases_scaled
    elif (domain_dim == 1):
        scales = np.linspace(scale_min, scale_max, (n_scales + n_rotates))
        phases_scaled_rotated = np.vstack([(phases_hex * i) for i in scales])
    elif (domain_dim == 2):
        angles = np.linspace(0, ((2 * np.pi) / 3), n_rotates)
        R_mats = np.stack([np.stack([np.cos(angles), (- np.sin(angles))], axis=1), np.stack([np.sin(angles), np.cos(angles)], axis=1)], axis=1)
        phases_scaled_rotated = (R_mats @ phases_scaled.T).transpose(0, 2, 1).reshape((- 1), domain_dim)
    else:
        R_mats = special_ortho_group.rvs(domain_dim, size=n_rotates)
        phases_scaled_rotated = (R_mats @ phases_scaled.T).transpose(0, 2, 1).reshape((- 1), domain_dim)
    axis_matrix = _constructaxisfromphases(phases_scaled_rotated)
    ssp_dim = axis_matrix.shape[0]
    super().__init__(domain_dim, ssp_dim, axis_matrix=axis_matrix, domain_bounds=domain_bounds, length_scale=length_scale)