Scattering of array of spheres, scalar theory
Project description
pyScatSpheres
Package for solving the scalar wave equation with a linear array of scattering spheres. Possibility to solve for constant potential well and hard spheres i.e. infinite potential.
Installation
pip install pyScatSpheres
The installation requires external system based installations :
- Fortran compiler : to run external library py3nj
- optional tex compiler : necessary for the figures to be displayed in latex text.
Those packages can be installed on linux with
apt-get install gfortranapt-get install tex-live
Using the GUI
A gui is available to interactively display pre calculated solutions.
import os
from pyScatSpheres import gui_base as hsa_gui
#fetch built-in solution
df_path=os.path.dirname(hsa_gui.__file__)+'/data/qdotSphereArray2_kp0.pkl'
hsa_e = hsa_gui.GUI_handler(df_path)
Using the API
New sets of solution can be calculated and solved to a pickle using the API.
import numpy as np
import pandas as pd
from pyScatSpheres import qdot_sphere_array as qsa
from pyScatSpheres import glob_colors as colors
kas = [0.5,2,5]
kds = [2,5,10]
kps = [1.2]
kas,kps,kds = np.meshgrid(kas,kps,kds)
kas,kps,kds = kas.flatten(),kps.flatten(),kds.flatten()
cols = ['N','ka','kp','kd','nmax','sigma','ap','bp']
df = pd.DataFrame(columns=cols)
for ka,kp,kd in zip(kas,kps,kds):
nmax = max(int(np.ceil(1.3*ka)),int(ka)+4)
s = qsa.QdotSphereArray(N=N,ka=ka,kp=kp,kd=kd*ka,nmax=10,solve=1,copt=1)
sig = s.get_s(npts=1000)
df=df.append(dict(zip(cols,[s.N,s.ka,s.kp,s.kd,s.nmax,sig,s.ap,s.bp])),ignore_index=True)
df.to_pickle(df_name)
print(colors.green+'DataFrame saved:\n'+ colors.yellow+df_name+colors.black)
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 pyScatSpheres-1.0.4.tar.gz.
File metadata
- Download URL: pyScatSpheres-1.0.4.tar.gz
- Upload date:
- Size: 5.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69ca63d04b72ce0c0087d42462f9a7c8352beee6df045fb479704a5d747d4973
|
|
| MD5 |
81cfee7361282636685a5da27385be3c
|
|
| BLAKE2b-256 |
958c8f41c775faaf85872328356ee7860ab567624fadca14fdc800862f29c50b
|
File details
Details for the file pyScatSpheres-1.0.4-py3-none-any.whl.
File metadata
- Download URL: pyScatSpheres-1.0.4-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
338da03f3424ded0d0b7b06980bbd72642c3433e85a658a6a313eaa691695bcb
|
|
| MD5 |
1c942f8161cd2b2e33684db90458fc64
|
|
| BLAKE2b-256 |
206c2cc44ef1fb271460143a3b091000cf42543b70340c022c797066dce49a4c
|