{"id":21605653,"url":"https://github.com/aspuru-guzik-group/qtorch","last_synced_at":"2025-04-11T04:04:15.565Z","repository":{"id":91293207,"uuid":"102640618","full_name":"aspuru-guzik-group/qtorch","owner":"aspuru-guzik-group","description":"qTorch (Quantum Tensor Contraction Handler) https://arxiv.org/abs/1709.03636 -\u003e for quantum simulation using tensor networks","archived":false,"fork":false,"pushed_at":"2019-03-06T19:46:35.000Z","size":6171,"stargazers_count":49,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T04:04:03.310Z","etag":null,"topics":["linegraph","maxcut","networks","qaoa","qtorch","quantum","quickbb","simulation","tensor"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspuru-guzik-group.png","metadata":{"files":{"readme":"README.txt","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,"governance":null}},"created_at":"2017-09-06T17:53:41.000Z","updated_at":"2025-03-15T05:31:18.000Z","dependencies_parsed_at":"2023-03-02T16:30:34.493Z","dependency_job_id":null,"html_url":"https://github.com/aspuru-guzik-group/qtorch","commit_stats":{"total_commits":16,"total_committers":6,"mean_commits":"2.6666666666666665","dds":0.5625,"last_synced_commit":"d564ae6d4f51fec8b8a7b61706ba5b28bd0380cf"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspuru-guzik-group%2Fqtorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspuru-guzik-group%2Fqtorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspuru-guzik-group%2Fqtorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspuru-guzik-group%2Fqtorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspuru-guzik-group","download_url":"https://codeload.github.com/aspuru-guzik-group/qtorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339286,"owners_count":21087215,"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":["linegraph","maxcut","networks","qaoa","qtorch","quantum","quickbb","simulation","tensor"],"created_at":"2024-11-24T20:16:35.300Z","updated_at":"2025-04-11T04:04:15.540Z","avatar_url":"https://github.com/aspuru-guzik-group.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Copyright 2017 Eric Schuyler Fried, Nicolas Per Dane Sawaya, Alán Aspuru-Guzik\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\n        limitations under the License.\n\n\n\n==================The qTorch Library================\n\nThere are three options to install the library: global \ninstallation, local installation, and docker. Here, we provide\na tutorial for each. gcc/g++ is the compiler used to compile and run the\nlibrary. The version of gcc/g++ must be recent enough support the C++14 \nstandard library. Otherwise, errors like: \"g++: error: unrecognized \ncommand line option '-std=c++14'\" may appear. In this case, we suggest\nthe user upgrade their gcc/g++ compiler to a more recent version.\n\n\n\n::::::: Global Installation (Admin Permissions Required) :::::::::::\n\n\n------- INSTALLING THE LIBRARY (REQUIRED FOR ANY TYPE OF USE) -------\nPlease type the command: \"sudo make install\" in a Unix command line to\ninstall globally for all users.\n\nThis next step is optional, but it will make it easier to write and link\ncustom .cpp files that extend the library. If the user doesn't want to \nchange any environment variables, they can simply run \"make all\", \n\"make cut\", or \"make qtorch\", then run the generated executables using \n./bin/qtorch or ./bin/maxcutQAOA\n\nOptional: The user should add the directories: /usr/local/bin and \n$HOME/usr/local/bin to the PATH environment variable. For bash shell users,\nthis means modifying the $HOME/.bash_rc, $HOME/.bash_profile, or the \n$HOME/.profile file, so that every time the user logs in and opens a shell \nscript, the PATH environment variable will change. Additionally, we recommend\nsetting the LIBRARY_PATH environment variable as well to reference the \ndirectories that we install the library in.\n\n-----------------------------------------------------------------------------\n\n\n\n----------- MAKING IT SO YOUR COMPILER CAN FIND THE EXECUTABLES ---------------\n\nSimple commands for bash user (default shell) - please copy and paste into shell:\n\n--THESE WILL SET THE PATH FOR THIS AND ALL FUTURE SHELL SESSIONS:--\n\necho 'export PATH=$PATH:/usr/local/bin:$HOME/usr/local/bin' \u003e\u003e $HOME/.bash_profile\nsource $HOME/.bash_profile\n\n--FOR ONLY CURRENT SHELL SESSION:--\n\nexport PATH=$PATH:/usr/local/bin:$HOME/usr/local/bin\n\n--SET LIBRARY_PATH VARIABLE ONLY FOR CURRENT SHELL SESSION:--\n\nexport LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib:$HOME/usr/local/lib\n\n--SET LIBRARY PATH FOR THIS AND ALL FUTURE SHELL SESSIONS:--\n\necho 'export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib:$HOME/usr/local/lib' \u003e\u003e $HOME/.bash_profile\nsource $HOME/.bash_profile\n--------------------------------------------------------------------------------\n\n\n\n---------- LINKING THE LIBRARY -------------------------------------------------\nFor users with a customized shell startup script, we ask that you add \n/usr/local/bin and $HOME/usr/local/bin to your PATH environment variable. \nAdditionally, add /usr/local/lib and $HOME/usr/local/lib to your LIBRARY_PATH\nenvironment variable.\n\nIf you set the LIBRARY_PATH variable, you can link the library with\nthe compiler flag: -ltncontr, else link using -L/usr/local/lib -ltncontr\n--------------------------------------------------------------------------------\n\n\n\n---------------- INCLUDING THE LIBRARY ----------------------------\nMake sure to include the line: \"#include \"tncontr.hpp\" at the top of \nany files that use the library, and link with the above linker flags.\n--------------------------------------------------------------------------------\n\n\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\n\n\n::::::::::: Local Installation (Admin Permissions NOT NEEDED) ::::::::::::::::::\n\n\n ----------- INSTALLING THE LIBRARY (REQUIRED FOR ANY TYPE OF USE) -------------\n Please type the command: \"make installlocal\" in a Unix command line to install \n globally for all users.\n\n This next step is optional, but it will make it easier to write and link custom \n .cpp files that extend the library. If the user doesn't want to change any \n environment variables, they can simply run \"make all\", \"make cut\", or \"make qtorch\",\n then run the generated executables using ./bin/qtorch or \n ./bin/maxcutQAOA\n\n Optional: The user should add the directory: $HOME/usr/local/bin to the PATH \n environment variable. For bash shell users, this means modifying the $HOME/.bash_rc,\n $HOME/.bash_profile, or the $HOME/.profile file, so that every time the user logs in\n and opens a shell script, the PATH environment variable will change. Additionally, \n we recommend setting the LIBRARY_PATH environment variable as well to reference \n the directories that we install the library in.\n\n -------------------------------------------------------------------------------\n\n\n\n----------- MAKING IT SO YOUR COMPILER CAN FIND THE EXECUTABLES ---------------\n\nSimple commands for bash user (default shell) - please copy and paste into shell:\n\n--THESE WILL SET THE PATH FOR THIS AND ALL FUTURE SHELL SESSIONS:--\n\necho 'export PATH=$PATH:$HOME/usr/local/bin' \u003e\u003e $HOME/.bash_profile\nsource $HOME/.bash_profile\n\n--FOR ONLY CURRENT SHELL SESSION:--\n\nexport PATH=$PATH:$HOME/usr/local/bin\n\n--SET LIBRARY_PATH VARIABLE ONLY FOR CURRENT SHELL SESSION:--\n\nexport LIBRARY_PATH=$LIBRARY_PATH:$HOME/usr/local/lib\n\n--SET LIBRARY PATH FOR THIS AND ALL FUTURE SHELL SESSIONS:--\n\necho 'export LIBRARY_PATH=$LIBRARY_PATH:$HOME/usr/local/lib' \u003e\u003e $HOME/.bash_profile\nsource $HOME/.bash_profile\n--------------------------------------------------------------------------------\n\n\n\n---------- LINKING THE LIBRARY -------------------------------------------------\n\nFor users with a customized shell startup script, we ask that you add \n$HOME/usr/local/bin to your PATH environment variable. Additionally, add \n$HOME/usr/local/lib to your LIBRARY_PATH environment variable.\n\nLink using: -L$(HOME)/usr/local/lib -I$(HOME)/usr/local/include\n\n--------------------------------------------------------------------------------\n\n\n---------------- INCLUDING THE LIBRARY ----------------------------\nMake sure to include the line: \"#include \"tncontr.hpp\" at the top of any files \nthat use the library, and link with the above linker flags.\n--------------------------------------------------------------------------------\n\n:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\n\n::::::::::::::::::::::::::::::::: Docker Installation :::::::::::::::::::::::::::\nAn alternative way of running qTorch is to run it inside a Docker container. \nThis allows the user to use qTorch regardless of the local environment \n(operating system, package dependencies etc) of her machine. We provide the\nfollowing Docker image on DockerHub: therealcaoyudong/qtorch, which contains\nthe qTorch source code as well as the necessary libraries needed for \nbuilding qTorch.\n\nHere, we provide a step-by-step instruction on how to use the Docker image, \nassuming no prior experience with Docker.\n\n1. Install Docker on your computer. Also VirtualBox is needed;\n\n2. In a command terminal, run: \n\ndocker-machine ls\n\nwhich returns a list of virtual machines. If the list is empty, \ncreate a virtual machine called default by running: \n\ndocker-machine create ---driver virtualbox default\n\n3. Configure the shell to the virtual machine by running: \n\ndocker-machine env default\n\nRun the command suggested by the returned message.\n\n4. Now everything is set up, run the image using:\n\ndocker run -it therealcaoyudong/qtorch\n\nIt may take a while to download the image. When the download is complete, \nthe shell header will look like \"root@c7d9e3be4c53#\". The hash string \nafter @ is the identifier of the Docker container started by the \"docker run\" \ncommand just executed. To see a list of running Docker containers, run: \n\ndocker ps\n\nNote that in addition to a hash string, each container is also labels \nwith a nickname (such as happy_einstein).\n\n5. The Docker container is effectively an Ubuntu environment with qTorch \ninstalled and executable from any directory. The source code for qTorch \ncan be located at \"/root/qtorch\". The user is free to re-build qTorch \nusing \"sudo make install\", then \"make all\", \"make qtorch\", \"make test\", \nor \"make cut\". To see if qTorch is correctly installed, run:\n\nqtorch\n\nThe output should ask for an input script file.\n\n:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\n\nThe library is then ready for use! See software guide in Appendix C of the qTorch \npaper for more details\n\n====================================================\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspuru-guzik-group%2Fqtorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspuru-guzik-group%2Fqtorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspuru-guzik-group%2Fqtorch/lists"}