{"id":17737722,"url":"https://github.com/tdegeus/qpot","last_synced_at":"2026-04-29T04:38:27.944Z","repository":{"id":36994213,"uuid":"293833863","full_name":"tdegeus/QPot","owner":"tdegeus","description":"Library to keep track of a sequential potential energy landscape","archived":false,"fork":false,"pushed_at":"2022-07-04T14:27:31.000Z","size":324,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-24T06:08:19.229Z","etag":null,"topics":["conda","potential-energy","python","qpot","xtensor"],"latest_commit_sha":null,"homepage":"https://tdegeus.github.io/QPot","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdegeus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-08T14:24:12.000Z","updated_at":"2022-02-18T16:45:37.000Z","dependencies_parsed_at":"2022-08-19T00:10:42.225Z","dependency_job_id":null,"html_url":"https://github.com/tdegeus/QPot","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/tdegeus/QPot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdegeus%2FQPot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdegeus%2FQPot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdegeus%2FQPot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdegeus%2FQPot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdegeus","download_url":"https://codeload.github.com/tdegeus/QPot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdegeus%2FQPot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261618130,"owners_count":23185095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conda","potential-energy","python","qpot","xtensor"],"created_at":"2024-10-26T01:42:30.112Z","updated_at":"2026-04-29T04:38:27.915Z","avatar_url":"https://github.com/tdegeus.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QPot\n\n[![CI](https://github.com/tdegeus/QPot/workflows/CI/badge.svg)](https://github.com/tdegeus/QPot/actions)\n[![Doxygen -\u003e gh-pages](https://github.com/tdegeus/QPot/workflows/gh-pages/badge.svg)](https://tdegeus.github.io/QPot)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/qpot.svg)](https://anaconda.org/conda-forge/qpot)\n\nLibrary to keep track of a sequential potential energy landscape.\n\nDocumentation: https://tdegeus.github.io/QPot\n\n## Contents\n\n## Overview\n\n### Disclaimer\n\nThis library is free to use under the\n[MIT license](https://github.com/tdegeus/QPot/blob/master/LICENSE).\nAny additions are very much appreciated, in terms of suggested functionality, code,\ndocumentation, testimonials, word-of-mouth advertisement, etc.\nBug reports or feature requests can be filed on\n[GitHub](https://github.com/tdegeus/QPot).\nAs always, the code comes with no guarantee.\nNone of the developers can be held responsible for possible mistakes.\n\nDownload:\n[.zip file](https://github.com/tdegeus/QPot/zipball/master) |\n[.tar.gz file](https://github.com/tdegeus/QPot/tarball/master).\n\n(c - [MIT](https://github.com/tdegeus/QPot/blob/master/LICENSE))\nT.W.J. de Geus (Tom) | tom@geus.me | www.geus.me |\n[github.com/tdegeus/QPot](https://github.com/tdegeus/QPot)\n\n### More information\n\n*   The documentation of the code.\n*   The code itself.\n*   The unit tests, under [test](./test).\n*   The examples, under [examples](./examples).\n\n### Implementation\n\n#### C++ and Python\n\nThe code is a C++ header-only library (see installation notes),\nbut a Python module is also provided (see installation notes).\nThe interfaces are identical except:\n\n+   All *xtensor* objects (`xt::xtensor\u003c...\u003e`) are *NumPy* arrays in Python.\n+   All `::` in C++ are `.` in Python.\n\n#### Chunked.hpp\n\nStorage of a chunk of the series of yield positions,\nincluding support to move along the full series by providing sequential chunks upon request.\n\n```cpp\n#include \u003cQPot/Chunked.hpp\u003e\n\nint main()\n{\n    xt::xtensor\u003cdouble,1\u003e y = xt::linspace\u003cdouble\u003e(-1, 10, 12);\n\n    QPot::Chunked yield(0.0, y);\n\n    std::cout \u003c\u003c yield.i() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.yleft() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.yright() \u003c\u003c std::endl;\n\n    yield.set_x(5.5);\n\n    return 0;\n}\n```\n\nSee QPot::Chunked for more information.\nFurthermore, please find [this example](./examples/frozen_sequence/main.cpp).\n\n#### Static.hpp\n\nStatic list of yield points.\n\n```cpp\n#include \u003cQPot/Static.hpp\u003e\n\nint main()\n{\n    xt::xtensor\u003cdouble,1\u003e y = xt::linspace\u003cdouble\u003e(-1, 10, 12);\n\n    QPot::Static yield(0.0, y);\n\n    std::cout \u003c\u003c yield.currentIndex() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldLeft() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldRight() \u003c\u003c std::endl;\n\n    yield.setPosition(5.5);\n\n    std::cout \u003c\u003c yield.currentIndex() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldLeft() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldRight() \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\nSee QPot::Static for more information.\n\n#### Redraw.hpp\n\nDynamically redraw yield points.\n\n```cpp\n#include \u003cQPot/Redraw.hpp\u003e\n\nint main()\n{\n    auto uniform = [=](std::array\u003csize_t, 2\u003e shape) {\n        return xt::ones\u003cdouble\u003e(shape); };\n\n    size_t N = 10;\n    xt::xtensor\u003cdouble,1\u003e x = xt::zeros\u003cdouble\u003e({N});\n\n    QPot::RedrawList yield(x, uniform);\n\n    std::cout \u003c\u003c yield.currentIndex() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldLeft() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldRight() \u003c\u003c std::endl;\n\n    x.fill(5.5)\n    yield.setPosition(x);\n\n    std::cout \u003c\u003c yield.currentIndex() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldLeft() \u003c\u003c std::endl;\n    std::cout \u003c\u003c yield.currentYieldRight() \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n\u003e   From Python one can use:\n\u003e\n\u003e   ```python\n\u003e   def uniform(shape):\n\u003e       return np.ones(shape)\n\u003e\n\u003e   x = np.random.rand([100])\n\u003e   y = QPot.RedrawList(x, uniform);\n\u003e   ```\n\nSee QPot::RedrawList for more information.\n\n### Installation\n\n#### C++ headers\n\n##### Using conda\n\n```bash\nconda install -c conda-forge qpot\n```\n\n##### From source\n\n```bash\n# Download QPot\ngit checkout https://github.com/tdegeus/QPot.git\ncd QPot\n\n# Install headers, CMake and pkg-config support\ncmake -Bbuild .\ncd build\nmake install\n```\n\n#### Python module\n\n##### Using conda\n\n```bash\nconda install -c conda-forge python-qpot\n```\n\nNote that *xsimd* and hardware optimisation are **not enabled**.\nTo enable them you have to compile on your system, as is discussed next.\n\n##### From source\n\n\u003e   You need *xtensor*, *xtensor-python* and optionally *xsimd* as prerequisites.\n\u003e   In addition *scikit-build* is needed to control the build from Python.\n\u003e   The easiest is to use *conda* to get the prerequisites:\n\u003e\n\u003e   ```bash\n\u003e   conda install -c conda-forge xtensor-python\n\u003e   conda install -c conda-forge xsimd\n\u003e   conda install -c conda-forge scikit-build\n\u003e   ```\n\u003e\n\u003e   If you then compile and install with the same environment\n\u003e   you should be good to go.\n\u003e   Otherwise, a bit of manual labour might be needed to\n\u003e   treat the dependencies.\n\n```bash\n# Download QPot\ngit checkout https://github.com/tdegeus/QPot.git\ncd QPot\n\n# Compile and install the Python module\n# (-vv can be omitted as is controls just the verbosity)\npython setup.py install --build-type Release -vv\n\n# OR, Compile and install the Python module with hardware optimisation\n# (with scikit-build CMake options can just be added as command-line arguments)\npython setup.py install --build-type Release -DUSE_SIMDD=1 -vv\n```\n\n### Compiling user-code\n\n#### Using CMake\n\n##### Example\n\nUsing *QPot* your `CMakeLists.txt` can be as follows\n\n```cmake\ncmake_minimum_required(VERSION 3.1)\nproject(example)\nfind_package(QPot REQUIRED)\nadd_executable(example example.cpp)\ntarget_link_libraries(example PRIVATE QPot)\n```\n\n##### Targets\n\nThe following targets are available:\n\n*   `QPot`\n    Includes *QPot* and the *xtensor* dependency.\n\n*   `QPot::assert`\n    Enables assertions by defining `QPOT_ENABLE_ASSERT`.\n\n*   `QPot::debug`\n    Enables all assertions by defining\n    `QPOT_ENABLE_ASSERT` and `XTENSOR_ENABLE_ASSERT`.\n\n*   `QPot::compiler_warings`\n    Enables compiler warnings (generic).\n\n##### Optimisation\n\nIt is advised to think about compiler optimisation and enabling *xsimd*.\nUsing *CMake* this can be done using the `xtensor::optimize` and `xtensor::use_xsimd` targets.\nThe above example then becomes:\n\n```cmake\ncmake_minimum_required(VERSION 3.1)\nproject(example)\nfind_package(QPot REQUIRED)\nfind_package(xtensor REQUIRED)\nfind_package(xsimd REQUIRED)\nadd_executable(example example.cpp)\ntarget_link_libraries(example PRIVATE\n    QPot\n    xtensor::optimize\n    xtensor::use_xsimd)\n```\n\nSee the [documentation of xtensor](https://xtensor.readthedocs.io/en/latest/) concerning optimisation.\n\n#### By hand\n\nPresuming that the compiler is `c++`, compile using:\n\n```\nc++ -I/path/to/QPot/include ...\n```\n\nNote that you have to take care of the *xtensor* dependency, the C++ version, optimisation,\nenabling *xsimd*, ...\n\n#### Using pkg-config\n\nPresuming that the compiler is `c++`, compile using:\n\n```\nc++ `pkg-config --cflags QPot` ...\n```\n\nNote that you have to take care of the *xtensor* dependency, the C++ version, optimization,\nenabling *xsimd*, ...\n\n### Change-log\n\n#### v0.12.0\n\n*   Great simplification: only two free-functions are left (#43).\n\n#### v0.9.9\n\n*   [CMake] Minor style updates (#37)\n\n#### v0.9.8\n\n*   [Python] Build with scikit-build (#36)\n\n#### v0.9.7\n\n*   [docs] Minor readme updates\n*   [CMake] Minor style updates (#35)\n*   [CMake] Improving handling options\n*   [Python] Switching to xtensor-python : avoids copies (#33)\n\n\n#### v0.9.6\n\n*   [setup.py] Adding missing import\n*   [CI] Changing dummy version\n*   Adding global CMake options (+ updating CI)\n*   Adding missing include\n*   Avoiding *setuptools_scm* dependency if `SETUPTOOLS_SCM_PRETEND_VERSION` is defined\n*   Building docs on release\n\n#### v0.9.5\n\n*   Minor bugfix bounds-check: including assertion of lock in criterion\n*   CMake updates.\n\n#### v0.9.4\n\n*   Adding convenience function `Chunked::size`.\n\n#### v0.9.3\n\n*   Adding convenience function `i_chunk`.\n\n#### v0.9.2\n\n*   Updating docs, readme, and example.\n*   `QPot::Chunked::redraw`: Allow trial.\n*   Applying latest pcg32 features.\n*   Adding test for `Chunked::ymin_chunk`.\n\n#### v0.9.1\n\n*   Minor CMake updates.\n*   Integrating Python API in CMake.\n*   Marking `Chunked::i()` const (#24).\n\n#### v0.9.0\n\n*   Adding: Chunked storage (#23)\n*   Fixing version in doxygen docs\n*   [CI] Minor style update\n*   Updating doxygen-awesome\n\n#### v0.8.0\n\n*   Simplifying CMake\n*   Minor documentation updates\n*   API change: \"yield()\" -\u003e \"yieldPosition()\" to avoid broken Python API\n\n#### v0.7.0\n\n*   Various documentation updates.\n*   Adding (optional) HDF5 test to test platform independence of sequence restore).\n*   Allowing restoring a sequence with less data.\n*   Allow prompt if a redraw was triggered on the last position update.\n\n#### v0.6.2\n\n*   Python API: relaxing dependencies.\n*   RedrawList: Adding extra assertion on position.\n\n#### v0.6.1\n\n*   Bugfix: making sure that \"m_idx\" is computed correctly after a redraw\n\n#### v0.6.0\n\n*   Adding QPot::random interface to simplify RedrawList and to make reconstruction in Python possible (see test).\n*   [docs] Dark background.\n\n#### v0.5.0\n\n*   Allow reconstruction of random RedrawList (see test-case).\n*   Adding documentation using doxygen.\n*   Switching to setuptools_scm for versioning.\n*   Minor style updates.\n\n#### v0.4.0\n\n*   Adding `nextYield`.\n\n#### v0.3.0\n\n*   Switching to GitHub CI.\n*   Adding `yield` to return the entire landscape or a cross-section.\n*   Adding offset overloads to `currentYieldLeft` and `currentYieldRight`.\n*   Adding `currentYield` to get the landscape around the current position.\n\n#### v0.2.0\n\n*   Adding \"checkYieldBoundLeft\" and \"checkYieldBoundRight\" to \"Static\".\n*   Using Catch2 to test for floats.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdegeus%2Fqpot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdegeus%2Fqpot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdegeus%2Fqpot/lists"}