issue_comments: 280422799
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/1265#issuecomment-280422799 | https://api.github.com/repos/pydata/xarray/issues/1265 | 280422799 | MDEyOklzc3VlQ29tbWVudDI4MDQyMjc5OQ== | 10928117 | 2017-02-16T18:51:30Z | 2017-02-16T18:51:30Z | NONE | Hi, I tried to came with a bit more interesting but still simple example ```python from itertools import product import numpy as np import pandas as pd import holoviews as hv hv.notebook_extension() def energies(L, a): k = np.pi * np.arange(1, L//a) / L return {'exact': k2, 'approx': 2*(1 - np.cos(k * a)) / a2} L = np.arange(10, 21, 2) a = np.array([1, .5, .25]) data = [] for Li, ai in product(L, a): output = dict(L=Li, a=ai) output.update(**energies(Li, ai)) data.append(output) df = pd.DataFrame(data) hmap_data = {} for n, row in df.iterrows(): key = row.L, row.a val = (hv.Points((np.arange(len(row.exact)), row.exact), kdims=['n', 'E']) * hv.Points((np.arange(len(row.approx)), row.approx), kdims=['n', 'E'])) hmap_data[key] = val hv.HoloMap(hmap_data, kdims=['L', 'a']).select(n=(0, 20), E=(0, 20)) ``` example is simple and don't include any serious simulation. I compare here energies of particle in 1D box vs what would came out from tight-binding simulation. Example is very simple but it captures situation that happens often when calculating spectrum of a finite system: for different system size we get different amount of energy levels. That simple example is manageable without any pandas or xarray machinery but imagine real simulation made with kwant for series of different input parameters (system dimensions, gate voltages, chemical potentials, etc...) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
207283854 |