Sample-based quantum diagonalization (SQD) release notes
Upcoming release
Bug Fixes
- pyscf is no longer considered a dependency on Windows, where it fails to install. However, Windows remains an unsupported platform.
0.8.0
New Features
-
Added support for Python 3.9.
-
All functions which take a
rand_seed
argument now also accept anumpy.random.Generator
instance as therand_seed
.
Upgrade Notes
- The ground state returned by
qiskit_addon_sqd.fermion.solve_fermion()
will now be an instance ofqiskit_addon_sqd.fermion.SCIState
, rather than a PySCFSCIVector
instance.
0.7.0
Bug Fixes
-
Fixed a bug in
qiskit_addon_sqd.fermion.solve_fermion()
andqiskit_addon_sqd.fermion.optimize_orbitals()
which causes the determinants for spin-up and spin-down to be incorrectly flipped before solving. -
Fixed a bug in open-shell workflows which would cause
qiskit_addon_sqd.fermion.optimize_orbitals()
to crash with amalloc
error.
0.6.0
Upgrade Notes
-
Specifying
addresses
as a keyword argument toqiskit_addon_sqd.fermion.solve_fermion()
andqiskit_addon_sqd.fermion.optimize_orbitals()
is no longer supported. Users may still passaddresses
as the first positional argument; however, this usage is deprecated. Users are encouraged to pass the bitstring matrix defining the subspace as the first positional arguments to these functions, as shown below.To upgrade, change this code
# DEPRECATED CODE from qiskit_addon_sqd.fermion import ( bitstring_matrix_to_sorted_addresses, solve_fermion, optimize_orbitals, ) bitstring_matrix = ... addresses = bitstring_matrix_to_sorted_addresses(bitstring_matrix, open_shell=open_shell) energy, coeffs, occs, spin = solve_fermion( addresses=addresses, hcore=hcore, eri=eri, ) ... e_oo, rotation, occs_oo = optimize_orbitals( addresses=addresses, hcore=hcore, eri=eri, ) ### SHOULD BECOME ### # NEW CODE from qiskit_addon_sqd.fermion import solve_fermion, optimize_orbitals bitstring_matrix = ... energy, coeffs, occs, spin = solve_fermion( bitstring_matrix, hcore=hcore, eri=eri, ) ... e_oo, rotation, occs_oo = optimize_orbitals( bitstring_matrix, hcore=hcore, eri=eri, )
Deprecation Notes
-
The
qiskit_addon_sqd.fermion.bitstring_matrix_to_sorted_addresses()
function has been deprecated in favor ofqiskit_addon_sqd.fermion.bitstring_matrix_to_ci_strs()
. These two functions behave the same with one key exception –qiskit_addon_sqd.fermion.bitstring_matrix_to_sorted_addresses()
returns the configurations astuple(spin_dn, spin_up)
; whereas,qiskit_addon_sqd.fermion.bitstring_matrix_to_ci_strs()
returns the configurations astuple(spin_up, spin_dn)
.To migrate
from qiskit_addon_sqd.fermion import ( bitstring_matrix_to_sorted_addresses, bitstring_matrix_to_ci_strs, ) # DEPRECATED CODE bs_matrix = ... addr_dn, addr_up = bitstring_matrix_to_sorted_addresses(bs_matrix, open_shell=True) ### SHOULD BECOME ### # NEW CODE bs_matrix = ... ci_strs_up, ci_strs_dn = bitstring_matrix_to_ci_strs(bs_matrix, open_shell=True)
-
The
addresses
argument toqiskit_addon_sqd.fermion.solve_fermion()
andqiskit_addon_sqd.fermion.optimize_orbitals()
has been deprecated in favor ofbitstring_matrix
. Users are no longer required to convert their configurations to integers; instead, they should now pass in the bitstring matrix specifying the subspace onto which to project and diagonalize the Hamiltonian. The conversion to the integer representation of determinants will be done internally.
Bug Fixes
-
Fixed a bug in
qiskit_addon_sqd.configuration_recovery.recover_configurations()
which would sometimes cause a divide-by-zero error when calculating individual bit-flip probability. -
Fixes a bug that caused configuration recovery to fail on bitstrings of length greater than 72.
0.5.0
Upgrade Notes
-
The
qiskit_addon_sqd.counts.generate_counts_bipartite_hamming()
,qiskit_addon_sqd.subsampling.postselect_and_subsample()
, andqiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight()
now require thehamming_right
andhamming_left
arguments to be specified as keyword arguments. Additionally, thesamples_per_batch
andn_batches
arguments toqiskit_addon_sqd.subsampling.postselect_and_subsample()
should now be passed as keyword arguments.To upgrade
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight from qiskit_addon_sqd.subsampling import postselect_and_subsample from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming counts = generate_counts_bipartite_hamming(num_samples, num_bits, num_elec_a, num_elec_b) ... bs_mat = post_select_by_hamming_weight(bs_mat_full, num_elec_a, num_elec_b) ... batches = postselect_and_subsample( bs_mat, probs_arr, num_elec_a, num_elec_b, samples_per_batch, num_batches, )
should be changed to
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight from qiskit_addon_sqd.subsampling import postselect_and_subsample from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming counts = generate_counts_bipartite_hamming(num_samples, num_bits, hamming_right=num_elec_a, hamming_left=num_elec_b) ... bs_mat = post_select_by_hamming_weight(bs_mat_full, hamming_right=num_elec_a, hamming_left=num_elec_b) ... batches = postselect_and_subsample( bs_mat, probs_arr, hamming_right=num_elec_a, hamming_left=num_elec_b, samples_per_batch=samples_per_batch, num_batches=num_batches, )
0.4.0
Prelude
This is a minor release which introduces a couple of small, but important, breaking changes to to the API. These changes allow for a more consistent pattern in specifying the number of alpha and beta electrons throughout both the chemistry and non-chemistry functions in the API.
Upgrade Notes
-
The
qiskit_addon_sqd.counts.generate_counts_bipartite_hamming()
,qiskit_addon_sqd.subsampling.postselect_and_subsample()
, andqiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight()
now take thehamming_right
positional argument before thehamming_left
argument to better match the rest of the workflow.To upgrade
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight from qiskit_addon_sqd.subsampling import postselect_and_subsample from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming counts = generate_counts_bipartite_hamming(num_samples, num_bits, num_elec_b, num_elec_a) ... bs_mat = post_select_by_hamming_weight(bs_mat_full, num_elec_b, num_elec_a) ... batches = postselect_and_subsample( bs_mat, probs_arr, num_elec_b, num_elec_a, samples_per_batch, n_batches, )
should be changed to
from qiskit_addon_sqd.configuration_recovery import post_select_by_hamming_weight from qiskit_addon_sqd.subsampling import postselect_and_subsample from qiskit_addon_sqd.counts import generate_counts_bipartite_hamming counts = generate_counts_bipartite_hamming(num_samples, num_bits, num_elec_a, num_elec_b) bs_mat = post_select_by_hamming_weight(bs_mat_full, num_elec_a, num_elec_b) ... batches = postselect_and_subsample( bs_mat, probs_arr, num_elec_a, num_elec_b, samples_per_batch, n_batches, )