I am trying to evaluate the spectrum for a graphene ribbon of varying widths. I am trying to do this by attaching leads to graphene resulting in an open hamiltonian but this is not compatible with the spectrum method.

glead = LP.honeycomb() |> onsite(4) - hopping(1) |> supercell(4,2) |> supercell((0,-1))|> greenfunction(GS.Schur(boundary = 0));
h = LP.honeycomb() |> onsite(4) - hopping(1) |> supercell(4,5) |> supercell |>
attach(glead, region = r -> SA[-√3/2,1/2]' * r > 3.5, reverse = true) |>
attach(glead, region = r -> SA[-√3/2,1/2]' * r < 0, reverse = false)
energies, phis = spectrum(h, point; solver=ES.ShiftInvert(ES.ArnoldiMethod(nev=28), 0.0))

Is there a way to obtain the spectrum for a ribbon?

There might be a slight conceptual problem here. Open systems don’t have, in general, a discrete eigenspectrum. In a way it has “infinite” number of eigenpairs, so it’s natural spectrum does not apply here. If the system is open but periodic (it has nothing attach-ed, you can compute its bands instead of the spectrum. In the case you describe, the appropriate equivalent is the local density of sates, or ldos.

This would be the ldos integrated over all your central region as a function of energy

julia> using GLMakie, Quantica
julia> glead = LP.honeycomb() |> onsite(4) - hopping(1) |> supercell(4,2) |> supercell((0,-1))|> greenfunction(GS.Schur(boundary = 0));
julia> g = LP.honeycomb() |> onsite(4) - hopping(1) |> supercell(4,5) |> supercell |>
attach(glead, region = r -> SA[-√3/2,1/2]' * r > 3.5, reverse = true) |>
attach(glead, region = r -> SA[-√3/2,1/2]' * r < 0, reverse = false) |> greenfunction;
julia> d = ldos(g[])
LocalSpectralDensitySlice{Float64} : local density of states at a fixed location and arbitrary energy
kernel : LinearAlgebra.UniformScaling{Bool}(true)
julia> ωs = subdiv(0, 8, 500); ds = [sum(d(ω)) for ω in ωs];
julia> lines(ωs, ds)