[1]    plot_path = os.path.join(args.output_dir, f"{sim_name}_plot.png")
[2]    plt.savefig(plot_path)
[3]    plt.close()
[4]
[5]    # Write a short Markdown report summarising the run
[6]    md_path = os.path.join(args.output_dir, f"{sim_name}_report.md")
[7]    with open(md_path, "w") as fh:
[8]        fh.write(f"# Simulation Report: {sim_name}\n\n")
[9]        fh.write(
[10]            "This report summarises the results of the discrete‑gauge/Wilson‑loop simulation.\n\n"
[11]        )
[12]        fh.write("## Parameters\n\n")
[13]        fh.write(f"- **b_values**: {b_vals}\n")
[14]        fh.write(f"- **k_values**: {k_vals}\n")
[15]        fh.write(f"- **n0_values**: {n0_vals}\n")
[16]        fh.write(f"- **L_values**: {L_vals}\n\n")
[17]        fh.write("## Results (first 10 rows)\n\n")
[18]        fh.write("````\n")
[19]        fh.write(df.head(10).to_string(index=False))
[20]        fh.write("\n````\n")
[21]
[22]
[23]if __name__ == "__main__":
[24]    main()
