34 source.
name = QStringLiteral(
"Round trip test");
35 source.
sourcePreset = QStringLiteral(
"Quantum Tunneling (E < V0)");
36 source.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 61.44);
37 source.
controls.insert(QStringLiteral(
"geometryComboBox"), 3);
38 source.
controls.insert(QStringLiteral(
"currentOverlayCheckBox"),
true);
75 gaussian.
value = -3.5f;
158 errorMessage = std::string(
"round trip parse failed: ") + qtError.toStdString();
165 restored.
controls.value(QStringLiteral(
"geometryComboBox")).toInt() != 3 ||
166 !restored.
controls.value(QStringLiteral(
"currentOverlayCheckBox")).toBool() ||
237 errorMessage =
"round trip values differ";
241 QTemporaryDir temporaryDirectory;
242 if (!temporaryDirectory.isValid()) {
243 errorMessage =
"cannot create temporary directory";
247 const QString fileName = temporaryDirectory.filePath(QStringLiteral(
"experiment.qpe.json"));
249 errorMessage = std::string(
"file save failed: ") + qtError.toStdString();
255 errorMessage = std::string(
"file load failed: ") + qtError.toStdString();
258 if (fileRestored.
controls.value(QStringLiteral(
"universeWidthSpinBox")).toDouble() != 61.44 ||
279 errorMessage =
"file round trip values differ";
285 talbotSource.
name = QStringLiteral(
"Talbot persistence test");
293 errorMessage = std::string(
"schema 13 Talbot preparation round trip failed: ") + qtError.toStdString();
299 vortexSource.
name = QStringLiteral(
"Vortex persistence test");
307 errorMessage = std::string(
"schema 14 Vortex preparation round trip failed: ") + qtError.toStdString();
314 andersonSource.
name = QStringLiteral(
"Anderson persistence test");
322 errorMessage = std::string(
"schema 15 Anderson preparation round trip failed: ") + qtError.toStdString();
328 kickedRotorSource.
name = QStringLiteral(
"Kicked Rotor persistence test");
339 errorMessage = std::string(
"schema 16 Kicked Rotor preparation round trip failed: ") + qtError.toStdString();
345 zenoSource.
name = QStringLiteral(
"Quantum Zeno persistence test");
359 errorMessage = std::string(
"schema 17 Quantum Zeno preparation round trip failed: ") + qtError.toStdString();
364 scarSource.
name = QStringLiteral(
"Quantum Scars persistence test");
371 errorMessage = std::string(
"schema 18 Quantum Scars round trip failed: ") + qtError.toStdString();
376 berrySource.
name = QStringLiteral(
"Berry Phase persistence test");
377 berrySource.
sourcePreset = QStringLiteral(
"Berry Phase / Geometric Phase");
378 berrySource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
399 errorMessage = std::string(
"schema 19 Berry Phase round trip failed: ") + qtError.toStdString();
404 loschmidtSource.
name = QStringLiteral(
"Loschmidt Echo persistence test");
405 loschmidtSource.
sourcePreset = QStringLiteral(
"Loschmidt Echo / Quantum Time Reversal");
406 loschmidtSource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
418 errorMessage = std::string(
"schema 20 Loschmidt Echo round trip failed: ") + qtError.toStdString();
423 moshinskySource.
name = QStringLiteral(
"Moshinsky Shutter persistence test");
424 moshinskySource.
sourcePreset = QStringLiteral(
"Moshinsky Shutter / Diffraction in Time");
425 moshinskySource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
430 moshinskyShutter.
value = 120.0f;
431 moshinskyShutter.
centerX = 0.0f;
432 moshinskyShutter.
centerY = 0.0f;
433 moshinskyShutter.
length = 19.0f;
435 const std::uint64_t moshinskyShutterId = moshinskySource.
potentialScene.
add(moshinskyShutter);
461 errorMessage = std::string(
"schema 21 Moshinsky Shutter round trip failed: ") + qtError.toStdString();
466 kapitzaSource.
name = QStringLiteral(
"Kapitza-Dirac persistence test");
467 kapitzaSource.
sourcePreset = QStringLiteral(
"Kapitza-Dirac Diffraction / Optical Standing Wave");
468 kapitzaSource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
493 errorMessage = std::string(
"schema 22 Kapitza-Dirac round trip failed: ") + qtError.toStdString();
498 aharonovSource.
name = QStringLiteral(
"Aharonov-Bohm persistence test");
499 aharonovSource.
sourcePreset = QStringLiteral(
"Aharonov-Bohm Effect / Magnetic Flux");
500 aharonovSource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
522 errorMessage = std::string(
"schema 23 Aharonov-Bohm round trip failed: ") + qtError.toStdString();
527 landauSource.
name = QStringLiteral(
"Landau persistence test");
528 landauSource.
sourcePreset = QStringLiteral(
"Landau Levels / Cyclotron Dynamics");
529 landauSource.
controls.insert(QStringLiteral(
"landauFieldSpinBox"), 0.72);
546 errorMessage = std::string(
"schema 24 Landau round trip failed: ") + qtError.toStdString();
551 hallSource.
name = QStringLiteral(
"Quantum Hall edge persistence test");
552 hallSource.
sourcePreset = QStringLiteral(
"Quantum Hall Edge State / Chiral Skipping Orbit");
553 hallSource.
controls.insert(QStringLiteral(
"hallEdgeFieldSpinBox"), -0.63);
576 errorMessage = std::string(
"schema 25 Quantum Hall edge round trip failed: ") + qtError.toStdString();
581 backflowSource.
name = QStringLiteral(
"Quantum backflow persistence test");
582 backflowSource.
sourcePreset = QStringLiteral(
"Quantum Backflow / Positive Momentum, Negative Current");
583 backflowSource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
608 errorMessage = std::string(
"schema 26 Quantum backflow round trip failed: ") + qtError.toStdString();
613 zitterSource.
name = QStringLiteral(
"Zitterbewegung persistence test");
614 zitterSource.
sourcePreset = QStringLiteral(
"Zitterbewegung / Free Dirac Wave Packet");
615 zitterSource.
controls.insert(QStringLiteral(
"universeWidthSpinBox"), 40.96);
640 errorMessage = std::string(
"schema 27 Zitterbewegung round trip failed: ") + qtError.toStdString();
645 kleinSource.
name = QStringLiteral(
"Klein tunneling persistence test");
646 kleinSource.
sourcePreset = QStringLiteral(
"Klein Tunneling / Supercritical Dirac Barrier");
648 kleinSource.
controls.insert(QStringLiteral(
"boundaryModeComboBox"), 1);
666 kleinRestored.
controls.value(QStringLiteral(
"boundaryModeComboBox")).toInt() != 1 ||
680 errorMessage = std::string(
"schema 28 Klein tunneling round trip failed: ") + qtError.toStdString();
685 QJsonObject schema27 = zitterJson;
686 schema27.insert(QStringLiteral(
"schemaVersion"), 27);
687 schema27.remove(QStringLiteral(
"quantumKleinTunneling"));
693 errorMessage = std::string(
"schema 27 compatibility failed: ") + qtError.toStdString();
698 QJsonObject schema26 = backflowJson;
699 schema26.insert(QStringLiteral(
"schemaVersion"), 26);
700 schema26.remove(QStringLiteral(
"quantumZitterbewegung"));
705 errorMessage = std::string(
"schema 26 compatibility failed: ") + qtError.toStdString();
710 QJsonObject schema25 = hallJson;
711 schema25.insert(QStringLiteral(
"schemaVersion"), 25);
712 schema25.remove(QStringLiteral(
"quantumBackflow"));
717 errorMessage = std::string(
"schema 25 compatibility failed: ") + qtError.toStdString();
722 QJsonObject schema24 = landauJson;
723 schema24.insert(QStringLiteral(
"schemaVersion"), 24);
724 schema24.remove(QStringLiteral(
"quantumHallEdge"));
729 errorMessage = std::string(
"schema 24 compatibility failed: ") + qtError.toStdString();
734 QJsonObject schema23 = aharonovJson;
735 schema23.insert(QStringLiteral(
"schemaVersion"), 23);
736 schema23.remove(QStringLiteral(
"quantumLandau"));
741 errorMessage = std::string(
"schema 23 compatibility failed: ") + qtError.toStdString();
746 QJsonObject schema22 = kapitzaJson;
747 schema22.insert(QStringLiteral(
"schemaVersion"), 22);
748 schema22.remove(QStringLiteral(
"quantumAharonovBohm"));
754 errorMessage = std::string(
"schema 22 compatibility failed: ") + qtError.toStdString();
759 QJsonObject schema21 = moshinskyJson;
760 schema21.insert(QStringLiteral(
"schemaVersion"), 21);
761 schema21.remove(QStringLiteral(
"kapitzaDiracInitialState"));
762 schema21.remove(QStringLiteral(
"quantumKapitzaDirac"));
768 errorMessage = std::string(
"schema 21 compatibility failed: ") + qtError.toStdString();
773 QJsonObject schema20 = loschmidtJson;
774 schema20.insert(QStringLiteral(
"schemaVersion"), 20);
775 schema20.remove(QStringLiteral(
"moshinskyInitialState"));
776 schema20.remove(QStringLiteral(
"quantumMoshinsky"));
783 errorMessage = std::string(
"schema 20 compatibility failed: ") + qtError.toStdString();
788 QJsonObject schema19 = berryJson;
789 schema19.insert(QStringLiteral(
"schemaVersion"), 19);
790 schema19.remove(QStringLiteral(
"quantumLoschmidt"));
797 errorMessage = std::string(
"schema 19 compatibility failed: ") + qtError.toStdString();
802 QJsonObject schema18 = json;
803 schema18.insert(QStringLiteral(
"schemaVersion"), 18);
804 schema18.remove(QStringLiteral(
"quantumBerry"));
813 errorMessage = std::string(
"schema 18 compatibility failed: ") + qtError.toStdString();
819 QJsonObject schema17 = json;
820 schema17.insert(QStringLiteral(
"schemaVersion"), 17);
821 schema17.remove(QStringLiteral(
"quantumScar"));
829 errorMessage = std::string(
"schema 17 compatibility failed: ") + qtError.toStdString();
835 QJsonObject schema16 = json;
836 schema16.insert(QStringLiteral(
"schemaVersion"), 16);
837 schema16.remove(QStringLiteral(
"quantumZeno"));
838 schema16.remove(QStringLiteral(
"quantumZenoInitialState"));
846 errorMessage = std::string(
"schema 16 compatibility failed: ") + qtError.toStdString();
852 QJsonObject schema15 = json;
853 schema15.insert(QStringLiteral(
"schemaVersion"), 15);
854 schema15.remove(QStringLiteral(
"kickedRotor"));
855 schema15.remove(QStringLiteral(
"kickedRotorInitialState"));
863 errorMessage = std::string(
"schema 15 compatibility failed: ") + qtError.toStdString();
868 QJsonObject schema14 = json;
869 schema14.insert(QStringLiteral(
"schemaVersion"), 14);
870 schema14.remove(QStringLiteral(
"andersonInitialState"));
876 errorMessage = std::string(
"schema 14 compatibility failed: ") + qtError.toStdString();
881 QJsonObject schema13 = json;
882 schema13.insert(QStringLiteral(
"schemaVersion"), 13);
883 schema13.remove(QStringLiteral(
"vortexInitialState"));
889 errorMessage = std::string(
"schema 13 compatibility failed: ") + qtError.toStdString();
894 QJsonObject schema12 = json;
895 schema12.insert(QStringLiteral(
"schemaVersion"), 12);
896 schema12.remove(QStringLiteral(
"talbotInitialState"));
902 errorMessage = std::string(
"schema 12 compatibility failed: ") + qtError.toStdString();
907 QJsonObject schema11 = json;
908 schema11.insert(QStringLiteral(
"schemaVersion"), 11);
909 schema11.remove(QStringLiteral(
"ramseyEnsemble"));
915 errorMessage = std::string(
"schema 11 compatibility failed: ") + qtError.toStdString();
920 QJsonObject schema10 = json;
921 schema10.insert(QStringLiteral(
"schemaVersion"), 10);
922 QJsonObject ramsey10 = schema10.value(QStringLiteral(
"ramseySequence")).toObject();
923 ramsey10.remove(QStringLiteral(
"echoEnabled"));
924 ramsey10.remove(QStringLiteral(
"echoPulseDuration"));
925 ramsey10.remove(QStringLiteral(
"echoPulsePhaseDegrees"));
926 schema10.insert(QStringLiteral(
"ramseySequence"), ramsey10);
932 errorMessage = std::string(
"schema 10 compatibility failed: ") + qtError.toStdString();
937 QJsonObject schema9 = json;
938 schema9.insert(QStringLiteral(
"schemaVersion"), 9);
939 schema9.remove(QStringLiteral(
"ramseySequence"));
944 errorMessage = std::string(
"schema 9 compatibility failed: ") + qtError.toStdString();
950 QJsonObject schema8 = json;
951 schema8.insert(QStringLiteral(
"schemaVersion"), 8);
952 QJsonObject sweep8 = schema8.value(QStringLiteral(
"linearSweep")).toObject();
953 sweep8.remove(QStringLiteral(
"returnEnabled"));
954 sweep8.remove(QStringLiteral(
"holdDuration"));
955 sweep8.remove(QStringLiteral(
"returnDuration"));
956 schema8.insert(QStringLiteral(
"linearSweep"), sweep8);
961 errorMessage = std::string(
"schema 8 compatibility failed: ") + qtError.toStdString();
967 QJsonObject schema2 = json;
968 schema2.insert(QStringLiteral(
"schemaVersion"), 2);
969 QJsonObject scene2 = schema2.value(QStringLiteral(
"potentialScene")).toObject();
970 QJsonArray objects2 = scene2.value(QStringLiteral(
"objects")).toArray();
971 while (objects2.size() > 2) objects2.removeLast();
972 for (
int i = 0; i < objects2.size(); ++i) {
973 QJsonObject o = objects2.at(i).toObject();
974 o.remove(QStringLiteral(
"sigmaX"));
975 o.remove(QStringLiteral(
"sigmaY"));
976 o.remove(QStringLiteral(
"curvatureX"));
977 o.remove(QStringLiteral(
"curvatureY"));
978 o.remove(QStringLiteral(
"slopeX"));
979 o.remove(QStringLiteral(
"slopeY"));
980 o.remove(QStringLiteral(
"softening"));
981 objects2.replace(i, o);
983 scene2.insert(QStringLiteral(
"objects"), objects2);
984 schema2.insert(QStringLiteral(
"potentialScene"), scene2);
993 errorMessage = std::string(
"schema 2 compatibility failed: ") + qtError.toStdString();
999 QJsonObject legacy = json;
1000 legacy.insert(QStringLiteral(
"schemaVersion"), 1);
1001 legacy.remove(QStringLiteral(
"potentialScene"));
1004 errorMessage = std::string(
"schema 1 compatibility failed: ") + qtError.toStdString();
1012 errorMessage =
"schema 1 compatibility values differ";
1016 QJsonObject incompatible = json;
1017 incompatible.insert(QStringLiteral(
"schemaVersion"), 999);
1019 errorMessage =
"incompatible schema was accepted";
1023 QJsonObject wrongFormat = json;
1024 wrongFormat.insert(QStringLiteral(
"format"), QStringLiteral(
"Other.Application"));
1026 errorMessage =
"foreign document format was accepted";