Performing a Jordan Wigner transformation on fermionic MPS or MPO

Is there a straightforward method to convert an MPS or MPO with electronic site indices into an MPS or MPO with spin 1/2 indices via a Jordan Wigner transformation?

For example, suppose I have Fermi-Hubbard Hamiltonian:

sites = siteinds("Electron", Nx*Ny; conserve_nf = true, conserve_nfparity = true)

lattice = square_lattice(Nx, Ny; yperiodic=false, xperiodic=false)

ampo = OpSum()
for b in lattice
    ampo += t, "Cdagup", b.s1, "Cup", b.s2
    ampo += t, "Cdagup", b.s2, "Cup", b.s1
    ampo += t, "Cdagdn", b.s1, "Cdn", b.s2
    ampo += t, "Cdagdn", b.s2, "Cdn", b.s1
end
for i in 1:N
    ampo += u, "Nupdn", i
end
H = MPO(ampo, sites)

Does ITensors have any implementation like jordan_wigner_transform(MPO::H) that will result in an MPO with site indices having something like
(dim=2|id=825|"S=1/2,Site,n=1")

We don’t have a function that does that. In your case, I would suggest performing the Jordan-Wigner transformation analytically (detailed guide about the math here http://itensor.org/docs.cgi?vers=cppv3&page=tutorials/fermions) and then inputting the resulting spin Hamiltonian into OpSum to make the spin MPO.

The MPO output by MPO already includes the Jordan-Wigner transformation. Are you specifically interested in having 2-dimension local Hilbert spaces instead of 4-dimensional local Hilbert spaces? If so you could use "Fermion" sites (which represent spinless fermions) and then write your OpSum in terms of spinless fermionic degrees of freedom.