def METHOD_NAME(self, n_orbitals, num_conserving):
    """Test Bogoliubov transform."""
    mapper = JordanWignerMapper()
    hamiltonian = random_quadratic_hamiltonian(
        n_orbitals, num_conserving=num_conserving, seed=5740
    )
    (
        transformation_matrix,
        orbital_energies,
        transformed_constant,
    ) = hamiltonian.diagonalizing_bogoliubov_transform()
    matrix = mapper.map(hamiltonian.second_q_op()).to_matrix()
    bog_circuit = BogoliubovTransform(transformation_matrix, qubit_mapper=mapper)
    for initial_state in range(2**n_orbitals):
        state = Statevector.from_int(initial_state, dims=2**n_orbitals)
        final_state = np.array(state.evolve(bog_circuit))
        occupied_orbitals = [i for i in range(n_orbitals) if initial_state >> i & 1]
        eig = np.sum(orbital_energies[occupied_orbitals]) + transformed_constant
        np.testing.assert_allclose(matrix @ final_state, eig * final_state, atol=1e-8)