Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with ACE fitting #224

Open
gelzinyte opened this issue Mar 1, 2023 · 9 comments
Open

Help with ACE fitting #224

gelzinyte opened this issue Mar 1, 2023 · 9 comments

Comments

@gelzinyte
Copy link
Contributor

No description provided.

@HaoWan321
Copy link

Is this ongoing work now? Yes, I am indeed experiencing using workflow with ACE where for now calling this ACE1pack is not clear for me, I get an error when I try to run ACE in workflow: " raise RuntimeError("Failed to get ace_path\n" + ace_path)\n RuntimeError: Failed to get ace_path \n ERROR: ArgumentError: Package ACE1pack not found in current path.
" So if there are some examples for this ACE fitting like preparation (like path to ACE1pack) before we use it and then how we use it.
Thank you in advance.

@gelzinyte
Copy link
Contributor Author

The ace fitting script is trying to locate the Julia script used for fitting ACE, which comes with ACE1pack. Are you able to locate ACE1pack.jl/scripts/ace_fit.jl yourself, e.g. julia $HOME/.julia/packages/ACE1pack/ChRvA/scripts/ace_fit.jl? You can pass this path to wfl.fit.ace.fit directly to disable it trying to find the path automatically.

As a test, does fitting with ACE1pack directly, without workflow, work?

@HaoWan321
Copy link

Without workflow, it worked. Using workflow I have an error:
"""
subprocess.CalledProcessError: Command 'julia /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl --params ACE_dir_0/fit_params_ACE_0.yaml > ACE_dir_0/ACE_0.stdout 2> ACE_dir_0/ACE_0.stderr ' returned non-zero exit status 1.
"""
In my .stderr file I get:
ERROR: LoadError: Unexpected character
Line: 0
Around: ...ACE_fname: ACE_dir_0/A...
^

Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] _error(message::String, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:140
[3] parse_jsconstant(#unused#::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:193
[4] parse_value(pc::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:170
[5] parse(str::String; dicttype::Type, inttype::Type{Int64}, allownan::Bool, null::Nothing)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:450
[6] (::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64})(io::IOStream)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:511
[7] open(f::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:384
[8] open
@ ./io.jl:381 [inlined]
[9] #parsefile#3
@ ~/.julia/packages/JSON/93Ea8/src/Parser.jl:509 [inlined]
[10] parsefile
@ ~/.julia/packages/JSON/93Ea8/src/Parser.jl:502 [inlined]
[11] load_json(fname::String)
@ ACEbase.FIO ~/.julia/packages/ACEbase/5cUVy/src/fio.jl:82
[12] top-level scope
@ ~/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl:39
in expression starting at /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl:39
The following is my params.json:
{
"data": {
"fname": "tmp_atoms_training.extxyz",
"energy_key": "DFT_energy",
"force_key": "DFT_forces",
"virial_key": "virial"
},
"basis": {
"pair_basis": {
"type": "pair",
"species": ["O", "Ir"],
"maxdeg": 6,
"r0": 2.88,
"rcut": 7.0
},
"ace": {
"type": "ace",
"species": ["O", "Ir"],
"N": 3,
"maxdeg": 6,
"r0": 2.88,
"radial": {
"type": "radial",
"r0": 2.88,
"rin": 1.728,
"rcut": 5.5
}
}
},
"weights": {
"default": {
"E": 30.0,
"F": 1.0,
"V": 0.0
},
"dimer": {
"E": 5.0,
"F": 1.0,
"V": 0.0
}
},
"solver": {
"type": "lsqr",
"damp": 0.01
},
"P": {
"type": "laplacian",
"rlap_scal": 3.0
},
"ACE_fname": "ACE_IrOx_2405.json"
}
This json file worked well (add e0 values in) when I do "julia /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl --params params.json"

@gelzinyte
Copy link
Contributor Author

Workflow minimally modifies the original parameter file. The modified file will be at "ACE_dir_0/fit_params_ACE_0.yaml ". Would you mind sharing/checking what the "ACE_fname" entry is? Could you share the whole file?

@HaoWan321
Copy link

the fit_params_ACE_0.yaml is like follow:
ACE_fname: ACE_dir_0/ACE_0.json
P:
rlap_scal: 3.0
type: laplacian
basis:
ace:
N: 3
maxdeg: 6
r0: 2.88
radial:
r0: 2.88
rcut: 5.5
rin: 1.728
type: radial
species:
- O
- Ir
type: ace
pair_basis:
maxdeg: 6
r0: 2.88
rcut: 7.0
species:
- O
- Ir
type: pair
data:
energy_key: DFT_energy
fname: ACE_dir_0/ACE_0_fitting_database.extxyz
force_key: DFT_forces
virial_key: DFT_virial
e0:
Ir: -0.33524439
O: -0.08969644
solver:
damp: 0.01
type: lsqr
weights:
default:
E: 30.0
F: 1.0
V: 0.0
dimer:
E: 5.0
F: 1.0
V: 0.0

@gelzinyte
Copy link
Contributor Author

The original error is complaining about this param file being malformed. Can you figure out how? e.g. run the command 'julia /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl --params ACE_dir_0/fit_params_ACE_0.yaml > ACE_dir_0/ACE_0.stdout 2> ACE_dir_0/ACE_0.stderr ' yourself and see if it still throws error?

@HaoWan321
Copy link

when I do ''julia /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl --params ACE_dir_0/fit_params_ACE_0.yaml > ACE_dir_0/ACE_0.stdout 2> ACE_dir_0/ACE_0.stderr '' I still got:
ERROR: LoadError: Unexpected character
Line: 0
Around: ...ACE_fname: ACE_dir_0/A...
^

Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] _error(message::String, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:140
[3] parse_jsconstant(#unused#::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:193
[4] parse_value(pc::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:170
[5] parse(str::String; dicttype::Type, inttype::Type{Int64}, allownan::Bool, null::Nothing)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:450
[6] (::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64})(io::IOStream)
@ JSON.Parser ~/.julia/packages/JSON/93Ea8/src/Parser.jl:511
[7] open(f::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:384
[8] open
@ ./io.jl:381 [inlined]
[9] #parsefile#3
@ ~/.julia/packages/JSON/93Ea8/src/Parser.jl:509 [inlined]
[10] parsefile
@ ~/.julia/packages/JSON/93Ea8/src/Parser.jl:502 [inlined]
[11] load_json(fname::String)
@ ACEbase.FIO ~/.julia/packages/ACEbase/5cUVy/src/fio.jl:82
[12] top-level scope
@ ~/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl:39
in expression starting at /home/hwan/.julia/packages/ACE1pack/EZ7bE/scripts/ace_fit.jl:39

@gelzinyte
Copy link
Contributor Author

Can you figure out in what way the wfl-created yml file is malformed?

@gelzinyte gelzinyte changed the title Add ACE fitting example to the docs. Help with ACE fitting May 25, 2023
@bernstei
Copy link
Contributor

Can you upload the ACE_dir_0/fit_params_ACE_0.yaml file here so we can look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants