by: Kevin Broløs
(Feyn version 1.4 or newer)
Feyn models are represented as graphs in SVG and they can be saved as an image.
Here's an example:
import feyn ql = feyn.connect_qlattice() models = ql.sample_models(['Hello'], 'World') model = models # As an .svg file with open(f'./model0.svg', 'w') as fd: fd.write(model._repr_svg_()) # As an .html file with open(f'./model0.html', 'w') as fd: fd.write(model._repr_html_())