Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
beb8bee0
Commit
beb8bee0
authored
May 01, 2020
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup trailing spaces in util scripts
parent
3137cbda
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
19 deletions
+19
-19
get_atomset.sh
util/get_atomset.sh
+1
-1
qbox_dos.py
util/qbox_dos.py
+1
-1
qbox_repair_h2o.py
util/qbox_repair_h2o.py
+3
-3
qbox_species_temp.sh
util/qbox_species_temp.sh
+1
-1
qbox_translate.sh
util/qbox_translate.sh
+1
-1
qbox_xyz.py
util/qbox_xyz.py
+1
-1
qso.py
util/qso.py
+6
-6
qso2qbox.py
util/qso2qbox.py
+2
-2
sample_to_move.sh
util/sample_to_move.sh
+1
-1
sample_to_sys.sh
util/sample_to_sys.sh
+2
-2
No files found.
util/get_atomset.sh
View file @
beb8bee0
...
...
@@ -4,5 +4,5 @@
# use: get_atomset sample.xml
#
nlines
=
$(
grep
/atomset
-m
1
-n
$1
| cut
-f1
-d
: -
)
head -
$nlines
$1
head -
$nlines
$1
echo
"</fpmd:sample>"
util/qbox_dos.py
View file @
beb8bee0
...
...
@@ -36,7 +36,7 @@ de = (emax - emin)/(ndos-1)
# f(x) = 1/(sqrt(pi)*width) * exp(-(x/width)^2 )
def
gauss
(
x
,
width
):
return
(
1.0
/
(
math
.
sqrt
(
math
.
pi
)
*
width
))
*
math
.
exp
(
-
(
x
/
width
)
**
2
)
# Qbox output handler to extract and process data
class
QboxOutputHandler
(
xml
.
sax
.
handler
.
ContentHandler
):
def
__init__
(
self
):
...
...
util/qbox_repair_h2o.py
View file @
beb8bee0
...
...
@@ -73,9 +73,9 @@ for h in hlist:
print
"# current "
,
h
[
1
],
" at "
,
h
[
3
],
h
[
4
],
h
[
5
]
print
"# nearest O is at "
,
nearest_o
[
3
],
nearest_o
[
4
],
nearest_o
[
5
]
print
"# move "
,
h
[
1
],
" by "
,
sx_min
,
sy_min
,
sz_min
h
[
3
]
+=
sx_min
h
[
4
]
+=
sy_min
h
[
5
]
+=
sz_min
h
[
3
]
+=
sx_min
h
[
4
]
+=
sy_min
h
[
5
]
+=
sz_min
for
o
in
olist
:
print
o
[
0
],
o
[
1
],
o
[
2
],
'
%10.5
f'
%
o
[
3
],
'
%10.5
f'
%
o
[
4
],
'
%10.5
f'
%
o
[
5
]
...
...
util/qbox_species_temp.sh
View file @
beb8bee0
...
...
@@ -7,7 +7,7 @@
# use: qbox_species_temp.sh species_name file [file ...]
#
if
((
$#<
2
))
then
echo
" use: qbox_species_temp.sh species file [file ...]"
then
echo
" use: qbox_species_temp.sh species file [file ...]"
exit
1
fi
species
=
$1
...
...
util/qbox_translate.sh
View file @
beb8bee0
#!/bin/bash
# qbox_translate: translate all atoms
# qbox_translate: translate all atoms
# use: qbox_replicate cell.sys dx dy dz > newcell.sys
#
if
((
$#
!=
4
))
...
...
util/qbox_xyz.py
View file @
beb8bee0
...
...
@@ -3,7 +3,7 @@
# This file is part of Qbox
#
# qbox_xyz.py: extract sets of atomic positions in xyz format
# from a Qbox output file or from a Qbox sample file using SAX
# from a Qbox output file or from a Qbox sample file using SAX
# incremental parsing
#
# use: qbox_xyz.py [-first] {file|URL}
...
...
util/qso.py
View file @
beb8bee0
...
...
@@ -45,10 +45,10 @@ class AtomSet:
class
Sample
:
def
__init__
(
self
):
self
.
atoms
=
AtomSet
()
# The following handler processes the <atomset> element of
# an XML document and updates the AtomSet data of the Sample
# If multiple instances of <atomset> are found, the
# If multiple instances of <atomset> are found, the
# handler overwrites the AtomSet data
class
QSOAtomSetHandler
(
xml
.
sax
.
handler
.
ContentHandler
):
def
__init__
(
self
,
sample
):
...
...
@@ -73,7 +73,7 @@ class QSOAtomSetHandler(xml.sax.handler.ContentHandler):
self
.
s
.
atoms
.
cell
.
a
=
attributes
[
"a"
]
self
.
s
.
atoms
.
cell
.
b
=
attributes
[
"b"
]
self
.
s
.
atoms
.
cell
.
c
=
attributes
[
"c"
]
elif
(
name
==
"species"
):
elif
(
name
==
"species"
):
self
.
inSpecies
=
True
self
.
species_name
=
"species_name"
if
"name"
in
attributes
:
...
...
@@ -83,9 +83,9 @@ class QSOAtomSetHandler(xml.sax.handler.ContentHandler):
self
.
species_href
=
attributes
[
"href"
]
self
.
species_symbol
=
self
.
species_name
+
"_symbol"
self
.
species_atomic_number
=
self
.
species_name
+
"_atomic_number"
self
.
species_mass
=
self
.
species_name
+
"_mass"
self
.
species_mass
=
self
.
species_name
+
"_mass"
elif
(
name
==
"atom"
)
and
self
.
inAtomSet
:
self
.
inAtom
=
True
self
.
inAtom
=
True
self
.
atom_name
=
attributes
[
"name"
]
self
.
atom_species
=
attributes
[
"species"
]
sp
=
Species
(
self
.
species_name
,
self
.
species_href
,
self
.
species_symbol
,
...
...
@@ -124,7 +124,7 @@ class QSOAtomSetHandler(xml.sax.handler.ContentHandler):
x
=
float
(
pos
[
0
])
y
=
float
(
pos
[
1
])
z
=
float
(
pos
[
2
])
self
.
atom_position
=
[
x
,
y
,
z
]
self
.
atom_position
=
[
x
,
y
,
z
]
self
.
inPosition
=
False
if
(
name
==
"velocity"
)
and
self
.
inAtom
:
vel
=
self
.
buffer
.
split
()
...
...
util/qso2qbox.py
View file @
beb8bee0
#!/usr/bin/python
# Convert <atomset> elements from quantum-simulation.org (QSO) format
# Convert <atomset> elements from quantum-simulation.org (QSO) format
# to Qbox input file
# use: qso2qbox.py [-last] {file|URL}
# Default: only the first <atomset> element is processed
...
...
@@ -10,7 +10,7 @@ import os.path
import
xml.sax
import
sys
import
urllib2
import
datetime
import
datetime
def
usage
():
print
"use: "
,
sys
.
argv
[
0
],
" [-last] {file|URL}"
...
...
util/sample_to_move.sh
View file @
beb8bee0
...
...
@@ -18,7 +18,7 @@ xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0">
</xsl:template>
<xsl:template match="atom">
<xsl:text>move </xsl:text>
<xsl:value-of select="@name"/>
<xsl:value-of select="@name"/>
<xsl:text> to </xsl:text>
<xsl:value-of select="position"/> <xsl:text>
</xsl:text>
...
...
util/sample_to_sys.sh
View file @
beb8bee0
...
...
@@ -32,8 +32,8 @@ xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0">
<xsl:text>atom </xsl:text>
<xsl:value-of select="@name"/> <xsl:text> </xsl:text>
<xsl:value-of select="@species"/> <xsl:text> </xsl:text>
<xsl:value-of select="position"/> <xsl:text> </xsl:text>
<xsl:value-of select="velocity"/> <xsl:text>
<xsl:value-of select="position"/> <xsl:text> </xsl:text>
<xsl:value-of select="velocity"/> <xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="*"/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment