Skip to content

Commit

Permalink
generator: Change base type of spin_component to 1-byte wide `std::…
Browse files Browse the repository at this point in the history
…uint8_t`
  • Loading branch information
krivenko committed Jul 27, 2024
1 parent b93ce35 commit 7c18b84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
Credits to Dr. Cezary Śliwa for providing the patch.
- Whenever possible, use compiler intrinsics to speed up complex bit
manipulation operations (``popcount``, ``tzcount``, ``pdep``, ``pext``).
- Change base type of ``spin_component`` to the 1-byte wide ``std::uint8_t``.
- New CMake option ``CPPCHECK_EXTRA_FLAGS``. It can be used to pass additional
command line flags to ``cppcheck``.

Expand Down
2 changes: 1 addition & 1 deletion doc/expression/generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ In other words,
- Among operators with the same :math:`S` and index sequence, :math:`S_+` comes
first followed by :math:`S_-` and eventually by :math:`S_z`.

.. enum:: spin_component : int
.. enum:: spin_component : std::uint8_t

Component of spin operator.

Expand Down
2 changes: 1 addition & 1 deletion include/libcommute/expression/generator_spin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace libcommute {
//

// S_+, S_- or S_z
enum spin_component : int { plus = 0, minus = 1, z = 2 };
enum spin_component : std::uint8_t { plus = 0, minus = 1, z = 2 };

template <typename... IndexTypes>
class generator_spin : public generator<IndexTypes...> {
Expand Down

0 comments on commit 7c18b84

Please sign in to comment.