def test_hermitian_conjugated():
    'Test hermitian_conjugated for the QubitOperator and Fermion Operator'
    qub_op1 = (((- 1j) * QubitOperator('X1 Y2')) + QubitOperator('X1'))
    qub_op2 = ((1j * QubitOperator('X1 Y2')) + QubitOperator('X1'))
    assert (hermitian_conjugated(qub_op1) == qub_op2)
    fer_op1 = FermionOperator('1^ 2')
    fer_op2 = FermionOperator('2^ 1')
    assert (hermitian_conjugated(fer_op1) == fer_op2)
    qubit_exc_op1 = QubitExcitationOperator(((4, 1), (1, 0)), 2j).normal_ordered()
    qubit_exc_op2 = QubitExcitationOperator(((4, 0), (1, 1)), (- 2j)).normal_ordered()
    assert (hermitian_conjugated(qubit_exc_op1) == qubit_exc_op2)
Test hermitian_conjugated for the QubitOperator and Fermion Operator
def test_hermitian_conjugated():
    
    qub_op1 = (((- 1j) * QubitOperator('X1 Y2')) + QubitOperator('X1'))
    qub_op2 = ((1j * QubitOperator('X1 Y2')) + QubitOperator('X1'))
    assert (hermitian_conjugated(qub_op1) == qub_op2)
    fer_op1 = FermionOperator('1^ 2')
    fer_op2 = FermionOperator('2^ 1')
    assert (hermitian_conjugated(fer_op1) == fer_op2)
    qubit_exc_op1 = QubitExcitationOperator(((4, 1), (1, 0)), 2j).normal_ordered()
    qubit_exc_op2 = QubitExcitationOperator(((4, 0), (1, 1)), (- 2j)).normal_ordered()
    assert (hermitian_conjugated(qubit_exc_op1) == qubit_exc_op2)