def test_jordan_wigner_transm_op(self):
    n = number_operator(self.n_qubits)
    n_jw = jordan_wigner(n)
    self.assertEqual((self.n_qubits + 1), len(n_jw.terms))
    self.assertEqual((self.n_qubits / 2.0), n_jw.terms[()])
    for qubit in range(self.n_qubits):
        operators = ((qubit, 'Z'),)
        self.assertEqual(n_jw.terms[operators], (- 0.5))
def test_jordan_wigner_transm_op(self):
    n = number_operator(self.n_qubits)
    n_jw = jordan_wigner(n)
    self.assertEqual((self.n_qubits + 1), len(n_jw.terms))
    self.assertEqual((self.n_qubits / 2.0), n_jw.terms[()])
    for qubit in range(self.n_qubits):
        operators = ((qubit, 'Z'),)
        self.assertEqual(n_jw.terms[operators], (- 0.5))