Skip to content

DBI class 3rd order GC and reduced 3rd math error #67

Description

@Sam-XiaoyueLi

Pulled from main branch. In double_bracket.py, within function eval_dbr_unitary, the operator for when the mode is DoubleBracketGeneratorType.group_commutator_3 and DoubleBracketGeneratorType.group_commutator_3_reduced has errors:

  1. step not using sqrt_step
  2. signs are wrong

Before modification, plotting the off-diagonal norm w.r.t DBR duration s gives
image

The suggested changes are

elif mode is DoubleBracketGeneratorType.group_commutator_3:
            if d is None:
                d = self.diagonal_h_matrix
            sqrt_step = np.sqrt(step)
            operator = (
                self.h.exp(sqrt_step * (np.sqrt(5) - 1) / 2)
                @ self.backend.calculate_matrix_exp(-sqrt_step * (np.sqrt(5) - 1) / 2, d)
                @ self.h.exp(-sqrt_step)
                @ self.backend.calculate_matrix_exp(sqrt_step * (np.sqrt(5) + 1) / 2, d)
                @ self.h.exp(sqrt_step * (3 - np.sqrt(5)) / 2)
                @ self.backend.calculate_matrix_exp(-sqrt_step, d)
            )
        elif mode is DoubleBracketGeneratorType.group_commutator_3_reduced:
            if d is None:
                d = self.diagonal_h_matrix
            sqrt_step = np.sqrt(step)
            operator = (
                 self.backend.calculate_matrix_exp(-sqrt_step * (np.sqrt(5) - 1) / 2, d)
                @ self.h.exp(-sqrt_step)
                @ self.backend.calculate_matrix_exp(sqrt_step * (np.sqrt(5) + 1) / 2, d)
                @ self.h.exp(sqrt_step * (3 - np.sqrt(5)) / 2)
                @ self.backend.calculate_matrix_exp(-sqrt_step, d)
            )
        return operator

After correcting:
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions