In [1]:
from pycalphad import Database, Model
model = Model(Database('alfe_sei.TDB'), ['AL', 'FE', 'VA'], 'B2_BCC')
variables = model.variables
In [2]:
print(variables)
In [3]:
from pycalphad.core.autograd_utils import build_functions
from autograd import elementwise_grad, grad
import numpy as np
o, g, h = build_functions(model.ast, variables)
N = 100
M = 100
y1 = np.random.rand(M,1)
y2 = np.random.rand(M,N)
y3 = np.random.rand(M,N)
y4 = np.random.rand(M,N)
y5 = np.random.rand(M,N)
y6 = np.random.rand(M,N)
%timeit ans1 = g(y1, y2, y3, y4, y5, y6)