コード例 #1
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(2, 'x')
P = {(1, 2): '(x1/2 + 1/4)'}

num_curl_operator_res = dict()
j = 2
for mesh_path in ['2Qmesh_10_2.npy', '2Qmesh_10_3.npy', '2Qmesh_10_4.npy', '2Qmesh_10_5.npy', '2Qmesh_10_6.npy', '2Qmesh_10_7.npy']:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_curl_operator(P, 1, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_curl_operator_res[f'10**{j}'] = tiempos
    j = j + 1

print(num_curl_operator_res)
print('Finish')
コード例 #2
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(2, 'x')
P = {(1, 2): '(x1/2 + 1/4)'}

num_bivector_res = dict()
j = 2
for mesh_path in [
        '2Qmesh_10_2.npy', '2Qmesh_10_3.npy', '2Qmesh_10_4.npy',
        '2Qmesh_10_5.npy', '2Qmesh_10_6.npy', '2Qmesh_10_7.npy',
        '2Qmesh_10_8.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_bivector(P, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_bivector_res[f'10**{j}'] = tiempos
コード例 #3
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

npg = NumPoissonGeometry(3, 'x')
P_sl2 = {(1, 2): '-x3', (1, 3): '-x2', (2, 3): 'x1'}
h = '(x1**2)/2 + (x2**2)/2 - (x3**2)/2'

num_hamiltonian_vf_res = dict()
j = 2
for mesh_path in [
        '3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy',
        '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy',
        '3Qmesh_10_8.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_hamiltonian_vf(P_sl2, h, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_hamiltonian_vf_res[f'10**{j}'] = tiempos
コード例 #4
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(4, 'x')
functions = ['1/2*x4', '-x1**2 + x2**2 + x3**2']

num_flaschka_ratiu_bivector_res = dict()
j = 2
for mesh_path in ['4Qmesh_10_2.npy', '4Qmesh_10_3.npy', '4Qmesh_10_4.npy', '4Qmesh_10_5.npy', '4Qmesh_10_6.npy', '4Qmesh_10_7.npy', '4Qmesh_10_8.npy', '4Qmesh_10_9.npy']:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_flaschka_ratiu_bivector(functions, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_flaschka_ratiu_bivector_res[f'10**{j}'] = tiempos
    print(tiempos)
    j = j + 1

print(num_flaschka_ratiu_bivector_res)
コード例 #5
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(3, 'x')
P = {(1, 2): '-x3', (1, 3): '-x2', (2, 3): 'x1'}

num_bivector_res = dict()
j = 2
for mesh_path in ['3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy', '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy', '3Qmesh_10_8.npy']:
    print(j)
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_linear_normal_form_R3(P, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_bivector_res[f'10**{j}'] = tiempos
    print(tiempos)
    j = j + 1

print(num_bivector_res)
コード例 #6
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

npg = NumPoissonGeometry(2, 'x')
P = {(1, 2): '(x1/2 + 1/4)'}
f = 'x1'
g = 'x2'

num_poisson_bracket_res = dict()
j = 2
for mesh_path in [
        '2Qmesh_10_2.npy', '2Qmesh_10_3.npy', '2Qmesh_10_4.npy',
        '2Qmesh_10_5.npy', '2Qmesh_10_6.npy', '2Qmesh_10_7.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as file:
        mesh = np.load(file)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_poisson_bracket(P, f, g, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_poisson_bracket_res[f'10**{j}'] = tiempos
コード例 #7
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(3, 'x')
P = {(1, 2): '-x3', (1, 3): '-x2', (2, 3): 'x1'}
W = {
    (1, ): 'x1 * x3 * exp(-1/(x1**2 + x2**2 - x3**2)**2) / (x1**2 + x2**2)',
    (2, ): 'x2 * x3 * exp(-1/(x1**2 + x2**2 - x3**2)**2) / (x1**2 + x2**2)',
    (3, ): 'exp(-1 / (x1**2 + x2**2 - x3**2)**2)'
}

num_coboundary_operator_res = dict()
j = 2
for mesh_path in [
        '3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy',
        '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_coboundary_operator(P, W, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
コード例 #8
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(3, 'x')
P_sl2 = {(1, 2): '-x3', (1, 3): '-x2', (2, 3): 'x1'}

num_bivector_to_matrix_res = dict()
j = 2
for mesh_path in [
        '3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy',
        '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy',
        '3Qmesh_10_8.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_bivector_to_matrix(P_sl2, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_bivector_to_matrix_res[f'10**{j}'] = tiempos
コード例 #9
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(2, 'x')
P = {(1, 2): '(x1/2 + 1/4)'}
Lambda = {(1, 2): '1'}

num_gauge_transformation_res = dict()
j = 2
for mesh_path in [
        '2Qmesh_10_2.npy', '2Qmesh_10_3.npy', '2Qmesh_10_4.npy',
        '2Qmesh_10_5.npy', '2Qmesh_10_6.npy', '2Qmesh_10_7.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_gauge_transformation(P, Lambda, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_gauge_transformation_res[f'10**{j}'] = tiempos
コード例 #10
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(3, 'x')
P = {(1, 2): '-x3', (1, 3): '-x2', (2, 3): 'x1'}

num_modular_vf_res = dict()
j = 2
for mesh_path in [
        '3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy',
        '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy',
        '3Qmesh_10_8.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_modular_vf(P, 1, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_modular_vf_res[f'10**{j}'] = tiempos
コード例 #11
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

print('Start')
npg = NumPoissonGeometry(3, 'x')
P_so3 = {(1, 2): 'x3', (1, 3): '-x2', (2, 3): 'x1'}
dK = {(1, ): 'x1', (2, ): 'x2', (3, ): 'x3'}

num_sharp_morphism_res = dict()
j = 2
for mesh_path in [
        '3Qmesh_10_2.npy', '3Qmesh_10_3.npy', '3Qmesh_10_4.npy',
        '3Qmesh_10_5.npy', '3Qmesh_10_6.npy', '3Qmesh_10_7.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_sharp_morphism(P_so3, dK, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_sharp_morphism_res[f'10**{j}'] = tiempos
コード例 #12
0
import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry

npg = NumPoissonGeometry(6, 'x')
P = {(1, 4): 1, (2, 5): 1, (3, 6): 1, (5, 6): 'x2**2'}
alpha = {(5, ): 1}
beta = {(6, ): 1}

num_one_forms_bracket_res = dict()
j = 2
for mesh_path in [
        '6Qmesh_10_2.npy', '6Qmesh_10_3.npy', '6Qmesh_10_4.npy',
        '6Qmesh_10_5.npy', '6Qmesh_10_6.npy', '6Qmesh_10_7.npy'
]:
    print(f'step {j}')
    tiempos = dict()
    with open(mesh_path, 'rb') as f:
        mesh = np.load(f)
    for k in range(25):
        A = datetime.datetime.now()
        npg.num_one_form_bracket(P, alpha, beta, mesh, pt_output=True)
        B = datetime.datetime.now()
        tiempos[k] = (B - A).total_seconds()
    promedio = stat.mean(tiempos.values())
    desviacion = stat.pstdev(tiempos.values())
    tiempos['promedios'] = promedio
    tiempos['desviacion'] = desviacion
    num_one_forms_bracket_res[f'10**{j}'] = tiempos