A package for local search algorithms on unit sphere designs
Project description
Unit Sphere A Designs
A package for computing A Designs over the unit sphere.
Installation
You can install the package using pip:
pip install .
Usage
Here is an example of how to use the package:
from unit_sphere_a_designs.local import local_search
import numpy as np
# Example Runs
d = 40
k = 2 * d + 1
# Run local search with a random staring solution
S_LS = local_search(d, k)
alg_val = np.trace(np.linalg.inv(S_LS @ S_LS.T))
print(f'Finished with a value of {float(alg_val):.5f}')
# Run local search with a fixed starting solution. Fix the first and third vectors so they are not replaced by the algortihm.
S_random = np.random.normal(size=(d, k))
S_random /= np.linalg.norm(S_random, axis=0, keepdims=True)
rand_val = np.trace(np.linalg.inv(S_random @ S_random.T))
print(f'Random solution has a value of {float(rand_val):.5f}')
S_LS_random_start = local_search(d, k, S = S_random, fixed_points = [0, 1, 2])
alg_val_rand_start = np.trace(np.linalg.inv(S_LS_random_start @ S_LS_random_start.T))
print(f'Finished with a value of {float(alg_val_rand_start):.5f}')
Running Tests
You can run the tests using pytest:
pytest tests/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unit_sphere_a_designs-0.1.0.tar.gz.
File metadata
- Download URL: unit_sphere_a_designs-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9634325b50d109fb8cd0aa46f2aa5b21598ed35ca6e7ac5bd60afaa0707866b
|
|
| MD5 |
311da6eeb4e0a2ae2de233f680c41ca3
|
|
| BLAKE2b-256 |
8eba639436e1cd1474bc3e11a9eed71ee4d9a35953f70dcd607382d915c592ff
|
File details
Details for the file unit_sphere_a_designs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unit_sphere_a_designs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
901ae2bde95384621be0120e4d8c22ba50b1d098864a1b8d82f713367aeb2997
|
|
| MD5 |
52bbab63140312ffc6ca3244645f37fc
|
|
| BLAKE2b-256 |
e86367eb7816aa03ef126878e5d0b127c96f8972aa24df4920fb5ef02fc71c1c
|