Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write determinants as 16 byte integers #46

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ wget https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85
&& tar -xzf boost_1_85_0.tar.gz -C $(pwd)/external \
&& rm boost_1_85_0.tar.gz

# Clone Dice/Riken branch
git clone https://github.com/caleb-johnson/Dice.git $(pwd)/external/Dice
# Clone Dice/bigdets branch
git clone -b bigdets https://github.com/caleb-johnson/Dice.git $(pwd)/external/Dice

export BOOST_ROOT=$(pwd)/external/boost_1_85_0
export CURC_HDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/openmpi/
Expand Down
14 changes: 7 additions & 7 deletions qiskit_addon_dice_solver/dice_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def solve_hci(

.. note::

Determinants are interpreted by the ``Dice`` command line application as 5-byte unsigned integers; therefore, only systems
of ``40`` or fewer orbitals are supported.
Determinants are interpreted by the ``Dice`` command line application as 16-byte unsigned integers; therefore, only systems
of ``128`` or fewer orbitals are supported.

Args:
hcore: Core Hamiltonian matrix representing single-electron integrals.
Expand Down Expand Up @@ -202,8 +202,8 @@ def solve_fermion(

.. note::

Determinants are interpreted by the ``Dice`` command line application as 5-byte unsigned integers; therefore, only systems
of ``40`` or fewer orbitals are supported.
Determinants are interpreted by the ``Dice`` command line application as 16-byte unsigned integers; therefore, only systems
of ``128`` or fewer orbitals are supported.

Args:
bitstring_matrix: A set of configurations defining the subspace onto which the Hamiltonian
Expand Down Expand Up @@ -401,12 +401,12 @@ def _write_input_files(

def _integer_to_bytes(n: int) -> bytes:
"""
Pack an integer into 5 bytes.
Pack an integer into 16 bytes.

The 5 is hard-coded because that is what the modified Dice branch
The 16 is hard-coded because that is what the modified Dice branch
expects currently.
"""
return int(n).to_bytes(5, byteorder="big")
return int(n).to_bytes(16, byteorder="big")


def _ci_strs_to_bytes(ci_strs: Sequence[int]) -> list[bytes]:
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/bigdets-ab774bbfc91ff01d.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
Bitstrings are no longer limited to ``80`` bits. Bitstrings up to length ``256`` are now accepted.
Loading