title: TypeError: bad operand type for unary -: 'function'
body: <p>This is the function I have. I am using it to simulate a Hamiltonian:</p>
  <pre><code>#Create the Hamiltonian of the interaction
    
  def Hamiltonian(t):
        
        
        #The transition frequency
        omega_trans=1
        
        #Create the sawtooth frequency chirp
        def theta(t):
            def eta(t):
                eta=signal.sawtooth( 2*np.pi *t)
            return eta
            theta=eta-omega_trans*t
            return theta
        
        #Assemble Hamiltonian
        Ham=(hbar/Omega)*(sigma_plus*np.exp(-theta*1j) + sigma_minus*np.exp(theta*1j))
        return Ham  
  </code></pre>
  <p>And I get this error:</p>
  <pre><code>TypeError: bad operand type for unary -: 'function'   
  </code></pre>
  <p>Why?</p>