# Path: EMpy/modesolvers/interface.py
# class Mode(object):
#     def get_x(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def get_y(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def intensity(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def TEfrac(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def overlap(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def get_fields_for_FDTD(self, x, y):
#         raise NotImplementedError()
# 
#     def save_for_FDTD(self, mode_id="", x=None, y=None):
#         """Save mode's fields on a staggered grid."""
#         Ex_FDTD, Ey_FDTD, Ez_FDTD, Hx_FDTD, Hy_FDTD, Hz_FDTD = self.get_fields_for_FDTD(
#             x, y
#         )
#         Ex_FDTD.real.T.tofile("ex" + mode_id + ".dat", sep=" ")
#         Ex_FDTD.imag.T.tofile("iex" + mode_id + ".dat", sep=" ")
#         Ey_FDTD.real.T.tofile("ey" + mode_id + ".dat", sep=" ")
#         Ey_FDTD.imag.T.tofile("iey" + mode_id + ".dat", sep=" ")
#         Ez_FDTD.real.T.tofile("ez" + mode_id + ".dat", sep=" ")
#         Ez_FDTD.imag.T.tofile("iez" + mode_id + ".dat", sep=" ")
#         Hx_FDTD.real.T.tofile("hx" + mode_id + ".dat", sep=" ")
#         Hx_FDTD.imag.T.tofile("ihx" + mode_id + ".dat", sep=" ")
#         Hy_FDTD.real.T.tofile("hy" + mode_id + ".dat", sep=" ")
#         Hy_FDTD.imag.T.tofile("ihy" + mode_id + ".dat", sep=" ")
#         Hz_FDTD.real.T.tofile("hz" + mode_id + ".dat", sep=" ")
#         Hz_FDTD.imag.T.tofile("ihz" + mode_id + ".dat", sep=" ")
# 
#     def plot(self, x=None, y=None):
#         raise NotImplementedError()
# 
# class ModeSolver(object):
#     def solve(self, *argv):
#         raise NotImplementedError()


from builtins import zip
from builtins import str
from builtins import range
from EMpy.modesolvers.interface import Mode, ModeSolver
        from scipy.sparse import coo_matrix
        from scipy.sparse.linalg import eigen
        from scipy.sparse import coo_matrix
        from scipy.sparse import coo_matrix
        from scipy.sparse.linalg import eigen
import numpy
import scipy
import scipy.optimize
import EMpy.utils
            import pylab
            import pylab
# pylint: disable=line-too-long,too-many-locals,too-many-statements,too-many-branches
# pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import
# pylint: disable=attribute-defined-outside-init,too-many-instance-attributes
# pylint: disable=arguments-differ,too-many-arguments
"""Finite Difference Modesolver.

@see: Fallahkhair, "Vector Finite Difference Modesolver for Anisotropic Dielectric Waveguides",
@see: JLT 2007 <http://www.photonics.umd.edu/wp-content/uploads/pubs/ja-20/Fallahkhair_JLT_26_1423_2008.pdf>}
@see: DOI of above reference <http://doi.org/10.1109/JLT.2008.923643>
@see: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=12734&objectType=FILE

"""
from __future__ import print_function





# Path: EMpy/modesolvers/interface.py
# class Mode(object):
#     def get_x(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def get_y(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def intensity(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def TEfrac(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def overlap(self, x=None, y=None):
#         raise NotImplementedError()
# 
#     def get_fields_for_FDTD(self, x, y):
#         raise NotImplementedError()
# 
#     def save_for_FDTD(self, mode_id="", x=None, y=None):
#         """Save mode's fields on a staggered grid."""
#         Ex_FDTD, Ey_FDTD, Ez_FDTD, Hx_FDTD, Hy_FDTD, Hz_FDTD = self.get_fields_for_FDTD(
#             x, y
#         )
#         Ex_FDTD.real.T.tofile("ex" + mode_id + ".dat", sep=" ")
#         Ex_FDTD.imag.T.tofile("iex" + mode_id + ".dat", sep=" ")
#         Ey_FDTD.real.T.tofile("ey" + mode_id + ".dat", sep=" ")
#         Ey_FDTD.imag.T.tofile("iey" + mode_id + ".dat", sep=" ")
#         Ez_FDTD.real.T.tofile("ez" + mode_id + ".dat", sep=" ")
#         Ez_FDTD.imag.T.tofile("iez" + mode_id + ".dat", sep=" ")
#         Hx_FDTD.real.T.tofile("hx" + mode_id + ".dat", sep=" ")
#         Hx_FDTD.imag.T.tofile("ihx" + mode_id + ".dat", sep=" ")
#         Hy_FDTD.real.T.tofile("hy" + mode_id + ".dat", sep=" ")
#         Hy_FDTD.imag.T.tofile("ihy" + mode_id + ".dat", sep=" ")
#         Hz_FDTD.real.T.tofile("hz" + mode_id + ".dat", sep=" ")
#         Hz_FDTD.imag.T.tofile("ihz" + mode_id + ".dat", sep=" ")
# 
#     def plot(self, x=None, y=None):
#         raise NotImplementedError()
# 
# class ModeSolver(object):
#     def solve(self, *argv):
#         raise NotImplementedError()


# Path: EMpy/modesolvers/FD.py
from builtins import zip
from builtins import str
from builtins import range
from EMpy.modesolvers.interface import Mode, ModeSolver
        from scipy.sparse import coo_matrix
        from scipy.sparse.linalg import eigen
        from scipy.sparse import coo_matrix
        from scipy.sparse import coo_matrix
        from scipy.sparse.linalg import eigen
import numpy
import scipy
import scipy.optimize
import EMpy.utils
            import pylab
            import pylab

# pylint: disable=line-too-long,too-many-locals,too-many-statements,too-many-branches
# pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import
# pylint: disable=attribute-defined-outside-init,too-many-instance-attributes
# pylint: disable=arguments-differ,too-many-arguments
"""Finite Difference Modesolver.

@see: Fallahkhair, "Vector Finite Difference Modesolver for Anisotropic Dielectric Waveguides",
@see: JLT 2007 <http://www.photonics.umd.edu/wp-content/uploads/pubs/ja-20/Fallahkhair_JLT_26_1423_2008.pdf>}
@see: DOI of above reference <http://doi.org/10.1109/JLT.2008.923643>
@see: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=12734&objectType=FILE

"""
from __future__ import print_function





class SVFDModeSolver(ModeSolver):