Release Notes

0.6.0

Upgrade Notes

  • Specifying addresses as a keyword argument to qiskit_addon_sqd.fermion.solve_fermion() and qiskit_addon_sqd.fermion.optimize_orbitals() is no longer supported. Users may still pass addresses 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 addresses argument to qiskit_addon_sqd.fermion.solve_fermion() and qiskit_addon_sqd.fermion.optimize_orbitals() has been deprecated in favor of bitstring_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

  • 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(), and qiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight() now require the hamming_right and hamming_left arguments to be specified as keyword arguments. Additionally, the samples_per_batch and n_batches arguments to qiskit_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(), and qiskit_addon_sqd.configuration_recovery.post_select_by_hamming_weight() now take the hamming_right positional argument before the hamming_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,
    )