Skip to content

xtb.input ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourcexTB input
idxtb.input
namexTB input
xml:basetopTemplate.xml

Input

xtb molecule.xyz --chrg -1 --uhf 2 --gfn 1 --alpb toluene --ohess

Input

$chrg 0

$spin 1

$gfn
   method=2
$end

Input

$set
   chrg 0
   uhf 1
   gfnver 2
$end

Output text

xml
<comment class="example.output" id="xtb.input.commandline">
        <module id="xtb.input">
            <scalar dataType="xsd:string" dictRef="xtb:programCall">xtb molecule.xyz --chrg -1 --uhf 2 --gfn 1 --alpb toluene --ohess</scalar>
            <scalar dataType="xsd:integer" dictRef="cc:charge">-1</scalar>
            <scalar dataType="xsd:integer" dictRef="xtb:spinPolarization">2</scalar>
            <scalar dataType="xsd:string" dictRef="xtb:gfnVersion">1</scalar>
            <scalar dataType="xsd:string" dictRef="xtb:solvent">toluene</scalar>
        </module>
    </comment>

Output text

xml
<comment class="example.output" id="xtb.input.xcontrol">
        <module id="xtb.input">
            <scalar dataType="xsd:integer" dictRef="cc:charge">0</scalar>
            <scalar dataType="xsd:integer" dictRef="xtb:spinPolarization">1</scalar>
            <scalar dataType="xsd:string" dictRef="xtb:gfnVersion">2</scalar>
        </module>
    </comment>

Template definition

xml
<templateList>  <template id="commandline" pattern="\s*(\S*[/\\])?xtb(\.exe)?\s+\S+.*" endPattern=".*" endPattern2="~">    <record id="programCall">\s*&#123;X,xtb:programCall&#125;\s*</record>    <transform process="pullup" xpath=".//cml:scalar" />    <transform process="delete" xpath=".//cml:list" />    <transform process="addChild" xpath="." elementName="cml:scalar" dictRef="cc:charge" value="$string(if (matches(substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --chrg '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -chrg '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --charge '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -charge '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -c '),' '),' '),'^[+-]?[0-9]+$')) then substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --chrg '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -chrg '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --charge '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -charge '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -c '),' '),' ') else '')" />    <transform process="addChild" xpath="." elementName="cml:scalar" dictRef="xtb:spinPolarization" value="$string(if (matches(substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --uhf '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -uhf '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -u '),' '),' '),'^[+-]?[0-9]+$')) then substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --uhf '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -uhf '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -u '),' '),' ') else '')" />    <transform process="addChild" xpath="." elementName="cml:scalar" dictRef="xtb:gfnVersion" value="$string(if (contains(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --gfnff ') or contains(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -gfnff ') or contains(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --gff ') or contains(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -gff ')) then 'ff' else substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --gfn '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -gfn '),' '),' '))" />    <transform process="addChild" xpath="." elementName="cml:scalar" dictRef="xtb:solvent" value="$string(substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --alpb '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -alpb '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --gbsa '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -gbsa '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -g '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --cpcmx '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -cpcmx '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --cosmo '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -cosmo '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --tmcosmo '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -tmcosmo '),' '),' '))" />    <transform process="addChild" xpath="." elementName="cml:scalar" dictRef="xtb:electronicTemperature" value="$string(substring-before(concat(substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --etemp '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -etemp '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' --temp '),substring-after(concat(' ',normalize-space(.//cml:scalar[@dictRef='xtb:programCall']),' '),' -temp '),' '),' '))" />    <transform process="delete" xpath="./cml:scalar[@dictRef='cc:charge'][string-length(normalize-space(.))=0]" />    <transform process="delete" xpath="./cml:scalar[@dictRef='xtb:spinPolarization'][string-length(normalize-space(.))=0]" />    <transform process="delete" xpath="./cml:scalar[@dictRef='xtb:gfnVersion'][string-length(normalize-space(.))=0]" />    <transform process="delete" xpath="./cml:scalar[@dictRef='xtb:solvent'][string-length(normalize-space(.))=0]" />    <transform process="delete" xpath="./cml:scalar[@dictRef='xtb:electronicTemperature'][string-length(normalize-space(.))=0]" />    <transform process="addAttribute" xpath="./cml:scalar[@dictRef='cc:charge']" name="dataType" value="xsd:integer" />    <transform process="addAttribute" xpath="./cml:scalar[@dictRef='xtb:spinPolarization']" name="dataType" value="xsd:integer" />    <transform process="addAttribute" xpath="./cml:scalar[@dictRef='xtb:gfnVersion']" name="dataType" value="xsd:string" />    <transform process="addAttribute" xpath="./cml:scalar[@dictRef='xtb:solvent']" name="dataType" value="xsd:string" />    <transform process="addAttribute" xpath="./cml:scalar[@dictRef='xtb:electronicTemperature']" name="dataType" value="xsd:double" />
        </template>  <template id="charge" pattern="\s*\u0024(chrg|charge)\s.*" endPattern=".*" endPattern2="~">    <record id="charge">\s*\u0024(?:chrg|charge)&#123;I,cc:charge&#125;.*</record>
        </template>  <template id="spin" pattern="\s*\u0024(spin|uhf)\s.*" endPattern=".*" endPattern2="~">    <record id="spin">\s*\u0024(?:spin|uhf)&#123;I,xtb:spinPolarization&#125;.*</record>
        </template>  <template id="gfn" pattern="\s*\u0024gfn\s*" endPattern="\s*\u0024.*" endPattern2="~">    <record id="method">\s*method\s*=\s*&#123;A,xtb:gfnVersion&#125;\s*</record>    <transform process="pullup" xpath=".//cml:scalar" />    <transform process="delete" xpath=".//cml:list" />
        </template>  <template id="gfnOneLine" pattern="\s*\u0024gfn\s+\S+\s*" endPattern=".*" endPattern2="~">    <record id="gfnOneLine">\s*\u0024gfn&#123;A,xtb:gfnVersion&#125;\s*</record>
        </template>  <template id="set" pattern="\s*\u0024set\s*" endPattern="\s*\u0024end.*" endPattern2="~">    <templateList>      <template id="charge" pattern="\s*(chrg|charge)\s+[+-]?[0-9]+\s*" endPattern=".*" endPattern2="~">        <record id="charge">\s*(?:chrg|charge)&#123;I,cc:charge&#125;\s*</record>
                </template>      <template id="spin" pattern="\s*uhf\s+[+-]?[0-9]+\s*" endPattern=".*" endPattern2="~">        <record id="spin">\s*uhf&#123;I,xtb:spinPolarization&#125;\s*</record>
                </template>      <template id="gfnver" pattern="\s*gfnver\s+\S+\s*" endPattern=".*" endPattern2="~">        <record id="gfnver">\s*gfnver&#123;A,xtb:gfnVersion&#125;\s*</record>
                </template>
            </templateList>    <transform process="pullup" xpath=".//cml:scalar" repeat="3" />    <transform process="delete" xpath=".//cml:list" />    <transform process="delete" xpath=".//cml:module[count(*)=0]" />
        </template>

    </templateList>
<transform process="pullup" xpath=".//cml:scalar" repeat="3" />
<transform process="delete" xpath=".//cml:list" />
<transform process="delete" xpath=".//cml:module[count(*)=0]" />