{"id":23927265,"url":"https://github.com/rbudai98/qsimulations","last_synced_at":"2025-07-27T19:39:27.959Z","repository":{"id":246915495,"uuid":"823224780","full_name":"rbudai98/QSimulations","owner":"rbudai98","description":"Python library for quantum systems and simulation","archived":false,"fork":false,"pushed_at":"2024-11-19T17:37:16.000Z","size":3063,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T22:16:29.130Z","etag":null,"topics":["anicillary-system","hamiltonian-dynamics","lindblad-master-equation","qubits"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/rbudai98.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-02T16:08:32.000Z","updated_at":"2024-11-19T17:37:20.000Z","dependencies_parsed_at":"2024-07-12T17:50:57.712Z","dependency_job_id":"0d1722db-a1e7-427f-a553-ea00718acbe5","html_url":"https://github.com/rbudai98/QSimulations","commit_stats":null,"previous_names":["rbudai98/qsimulations"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbudai98%2FQSimulations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbudai98%2FQSimulations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbudai98%2FQSimulations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbudai98%2FQSimulations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbudai98","download_url":"https://codeload.github.com/rbudai98/QSimulations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240400334,"owners_count":19795332,"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":["anicillary-system","hamiltonian-dynamics","lindblad-master-equation","qubits"],"created_at":"2025-01-05T22:16:32.140Z","updated_at":"2025-02-24T01:14:49.406Z","avatar_url":"https://github.com/rbudai98.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QSimulations [![Python Package using Conda](https://github.com/rbudai98/QSimulations/actions/workflows/python-package-conda.yml/badge.svg)](https://github.com/rbudai98/QSimulations/actions/workflows/python-package-conda.yml)\nPython library for quantum systems and simulation\n\n## Overview\nThis module provides various tools and utilities for simulating quantum systems. It includes functions for handling common quantum operations, such as Pauli operators, outer products, commutators, and anti-commutators. Additionally, it provides a class `qsimulations` to manage and simulate time-dependent quantum systems with ancillary qubits and damping operators.\n\n## Articles\n* [Single-ancilla ground state preparation via Lindbladians](https://arxiv.org/abs/2308.15676)\n* [Simulating Open Quantum Systems Using Hamiltonian Simulations](https://arxiv.org/abs/2311.15533)\n\n## Simulations:\n* `TFIM_time_indep_multi_qubit_.ipynb`: Time independent transverse-field Ising model\n* `TFIM_time_dependent_mult_qub.ipynb`: Time dependent transverse-field Ising model\n* `Fermi_Hub_multi_qubit.ipynb`: Fermi-Hubbard model\n\n## Functions\n\n### Utility Functions\n\n#### Pauli_array\n```python\ndef Pauli_array(op, poz, size):\n```\nGenerates a Pauli operator for a given position in a system.\n\n- `op` (np.array): The Pauli operator (X, Y, Z).\n- `poz` (int): Position of the operator in the system.\n- `size` (int): Total size of the system.\n\n#### outer_prod\n```python\ndef outer_prod(left_poz, right_poz, size):\n```\nComputes the outer product of two states.\n\n- `left_poz` (int): Position of the 1 in the ket vector.\n- `right_poz` (int): Position of the 1 in the bra vector.\n- `size` (int): Size of the overall system.\n\n#### commute\n```python\ndef commute(op1, op2):\n```\nCalculates the commutator of two operators.\n\n- `op1` (np.array): First operator.\n- `op2` (np.array): Second operator.\n\n#### anti_commute\n```python\ndef anti_commute(op1, op2):\n```\nCalculates the anti-commutator of two operators.\n\n- `op1` (np.array): First operator.\n- `op2` (np.array): Second operator.\n\n#### Taylor_approximation\n```python\ndef Taylor_approximtion(H_op, order, dt, initial_state):\n```\nComputes the Taylor approximation for a given Hamiltonian.\n\n- `H_op` (Qobj): Hamiltonian to be approximated.\n- `order` (int): Order of the approximation.\n- `dt` (float): Time step.\n- `initial_state` (Qobj): Initial state of the system.\n\n## Class: `qsimulations`\nThe `qsimulations` class provides a framework for setting up and running quantum simulations with ancillary qubits and damping operators.\n\n### Initialization\n```python\ndef __init__(self, H=0, systemSize=0, nrOfDampingOps=0, nrOFAncillas=0):\n```\nInitializes the simulation parameters.\n\n- `H` (Qobj): Hamiltonian of the system.\n- `systemSize` (int): Size of the quantum system.\n- `nrOfDampingOps` (int): Number of damping operators.\n- `nrOFAncillas` (int): Number of ancillary qubits.\n\n### Methods\n\n#### `set_H_op`\n```python\ndef set_H_op(self, H_tmp):\n```\nSets the Hamiltonian of the system.\n\n- `H_tmp` (Qobj): New Hamiltonian.\n\n#### `set_system_size`\n```python\ndef set_system_size(self, size):\n```\nSets the size of the quantum system.\n\n- `size` (int): New system size.\n\n#### `set_nr_of_damping_ops`\n```python\ndef set_nr_of_damping_ops(self, nr):\n```\nSets the number of damping operators.\n\n- `nr` (int): Number of damping operators.\n\n#### `set_nr_of_ancillas`\n```python\ndef set_nr_of_ancillas(self, nr):\n```\nSets the number of ancillary qubits.\n\n- `nr` (int): Number of ancillary qubits.\n\n#### `H_op`\n```python\ndef H_op(self):\n```\nReturns the Hamiltonian of the system.\n\n#### `V_op`\n```python\ndef V_op(self, i):\n```\nReturns the damping operator for a given index.\n\n- `i` (int): Index of the damping operator.\n\n#### `H_op_derivative`\n```python\ndef H_op_derivative(self):\n```\nReturns the time derivative of the Hamiltonian.\n\n#### `V_op_derivative`\n```python\ndef V_op_derivative(self, i):\n```\nReturns the time derivative of a damping operator.\n\n- `i` (int): Index of the damping operator.\n\n#### `sum_of_V_dag_V`\n```python\ndef sum_of_V_dag_V(self):\n```\nReturns the summation of all damping operators.\n\n#### `H_tilde_first_order`\n```python\ndef H_tilde_first_order(self, dt):\n```\nCalculates the first-order approximation of the Hamiltonian.\n\n- `dt` (float): Time step.\n\n#### `H_tilde_second_order`\n```python\ndef H_tilde_second_order(self, dt):\n```\nCalculates the second-order approximation of the Hamiltonian.\n\n- `dt` (float): Time step.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbudai98%2Fqsimulations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbudai98%2Fqsimulations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbudai98%2Fqsimulations/lists"}