Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add high-dimensional manifolds #10

Open
Filco306 opened this issue Nov 12, 2020 · 11 comments
Open

Add high-dimensional manifolds #10

Filco306 opened this issue Nov 12, 2020 · 11 comments

Comments

@Filco306
Copy link
Contributor

Filco306 commented Nov 12, 2020

Hello!

First of all, thank you for a very nice python package! I think high-dimensional manifolds, that is, manifolds beyond 2 and 3 dimensions would be very interesting to add. d-dimensional spheres have already been added, but if somebody knows how generate other types of manifolds of higher dimensions, I would be happy to cooperate and contribute to create this for this package :)

Cheers,
Filip

@ctralie
Copy link
Member

ctralie commented Nov 12, 2020 via email

@Filco306
Copy link
Contributor Author

How great to hear! I think #11 is a start, but what other high-dimensional manifolds can we construct?

@Filco306
Copy link
Contributor Author

Have a look here. He claims an n-dimensional Torus can simply be built by taking the cartesian of S^1, seen here. Can we use this perhaps?

@ctralie
Copy link
Member

ctralie commented Nov 12, 2020 via email

@Filco306
Copy link
Contributor Author

Hmm, I am not sure I understand how you mean. Do you perhaps have some sample code?

@ctralie
Copy link
Member

ctralie commented Nov 13, 2020 via email

@Filco306
Copy link
Contributor Author

Very sorry for such a late reply. That is very interesting, I suppose we can extend that to an arbitrary number of dimensions?

@Filco306
Copy link
Contributor Author

Would something like this do as a first draft?

def sample_4d_torus(n_points, seed):
    assert np.sqrt(n_points) % 1 == 0, "Please pick a number of points with integer root. "
    np.random.seed(seed)
    N = int(np.sqrt())
    t = np.random.uniform(0,2*np.pi, N)
    t = np.linspace(0, 2*np.pi, N)
    theta, phi = np.meshgrid(t, t)
    theta = theta.flatten()
    phi = phi.flatten()
    X = np.zeros((N*N, 4))
    X[:, 0] = np.cos(theta)
    X[:, 1] = np.sin(theta)
    X[:, 2] = np.cos(phi)
    X[:, 3] = np.sin(phi)
    return X

@ctralie
Copy link
Member

ctralie commented Feb 12, 2021 via email

@Filco306
Copy link
Contributor Author

Filco306 commented Feb 12, 2021

Oh yes, it should be int(np.sqrt(n_points)). Can we extend this to more than 4 dimensions?

@ctralie
Copy link
Member

ctralie commented Feb 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants