.. _mat-cli: Command line ============ Basic examples -------------- With ``snt`` on ``PATH``, print a formula mass: .. code-block:: bash snt mat substance "H2O" --field formula_mass # 18.015286*u Calculate the total mass of one litre of brine: .. code-block:: bash snt mat material "0.965 0.035 " --norm mass_fraction \ --mass-density "1.02*g/cm3" --volume "1*L" --field matter_mass # 1.02e3*g Common workflows ---------------- .. list-table:: :header-rows: 1 * - Task - Command - Output * - Show a complete report - ``snt mat element|substance|material `` - Labelled human-readable fields * - Print selected values - ``--field NAME [--field NAME ...]`` - One unlabelled value per line * - Derive matter values - ``--mass-density`` and ``--volume``, or another matter pair - Requested ``matter_*`` fields * - Normalize a mixture - ``--norm number|number_fraction|mass_fraction`` - Material composition in that normalization * - Choose isotope handling - ``--natural`` or ``--default-isotopes`` - Natural abundances or the deterministic default isotope * - Inspect a failure - Read stderr and the nonzero exit status - Error message; no partial report .. code-block:: bash snt mat substance "H2O" snt mat substance "H2O" --field formula_mass snt mat material "0.965 0.035 " --norm mass_fraction \ --mass-density "1.02*g/cm3" --volume "1*L" \ --field matter_mass --field matter_number_density snt mat element "Cm" --default-isotopes --field mass --field isotope_selection Without ``--field``, each command prints the full report. With ``--field``, stdout contains only values and loses their labels, which is convenient in shell pipelines. Invalid expressions, unavailable optional fields, and invalid options are written to stderr and return a nonzero status. Use ``--field`` to print only selected values. See the :doc:`CLI guide <../../../integrations/cli>` for normalization, matter options, and the complete field list. Current limitations and differences ----------------------------------- Compared with the canonical C++ implementation: - Each invocation evaluates one expression and prints a report or selected fields. It does not expose typed C++ records or mutable composition objects. - ``--field`` reports summary values; requesting an unavailable optional field is an error. Use C++, Python, or the web records for programmatic access to the complete component hierarchy. - Normalization, isotope selection, and matter inputs follow the native implementation. The physical assumptions and limits are unchanged. Command reference ----------------- This is a command lookup, not a set of examples to run in order. Use `Common workflows` above to choose a task, then find the exact invocation below. Run ``snt mat --help`` or ``snt mat --help`` for the current option list. - ``snt mat element `` reports isotope, charge, mass, nucleon, and optional matter values. - ``snt mat substance `` reports stoichiometry and optional matter values. - ``snt mat material `` reports a normalized mixture and optional matter values. - ``--natural`` and ``--default-isotopes`` select the isotope mode. - ``--norm number|number_fraction|mass_fraction`` applies to materials. - ``--number-density``, ``--mass-density``, ``--volume``, and ``--mass`` accept PUQ quantity strings. - ``--field NAME`` selects one summary field and may be repeated. The field groups are ``element``, ``substance``, ``material``, and ``matter``; run ``snt mat --help`` for the complete list.