Skip to content

Commit

Permalink
draf tnotebooks with some checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ismael-mendoza committed Dec 4, 2024
1 parent e7b889d commit 6e9b526
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 134 deletions.
170 changes: 170 additions & 0 deletions notebooks/check-g-mag-random.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"rng = np.random.RandomState(43)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"g1, g2 = rng.normal(size=(2, 1_000_000))*1e-3 + 0.02"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1.00132769e-06, 6.64097921e-10],\n",
" [6.64097921e-10, 9.97662766e-07]])"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.cov(g1, g2)"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.0010006631265643401, 0.000998830200162854, 0.0009997776905801786)"
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.std(g1), np.std(g2), np.std(np.sqrt(g1**2 + g2**2)) "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1.6044601312014296e-09,\n",
" 1.5979783261011428e-09,\n",
" 3.204493672957289e-09,\n",
" 9.995554305818354e-07)"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.var(g1**2), np.var(g2**2), np.var(g1**2 + g2**2)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"# g1+= 0.02"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1.4332765422958652e-06, 1.4438625190160518e-06, 2.032142858328091e-06)"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4.019049885896081e-05"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.std(g1**2 + g2**2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "bpd_gpu2",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 6e9b526

Please sign in to comment.