<commit_before>// depends: jsqis-core.js
//
// depends: jQuery
// depends: raphael

jQuery.extend(window.jsqis, (function ($, Raphael) {

    var PhotonView = function (parentElement, machine, options) {
        this.options = $.extend({}, PhotonView.defaultOptions, options);
        var r1 = 50 * this.options.scale,
            r2 = 5 * this.options.scale;
        this.paper = Raphael(parentElement[0], 2 * r1, 2 * r1);
        // see https://github.com/DmitryBaranovskiy/raphael/issues/297
        this.paper.circle(r1, r1, r1 - r2).attr({fill: "r#aaa-#fff", stroke: "none", opacity: 0});
        this.circle = this.paper.circle(r1, r1, r2).attr({fill: "#00a", stroke: "#00e"});
        this.t = 0;
        this.r3 = r1 - r2;
        this.update(machine);
        this.render();
    };
    PhotonView.defaultOptions = {
        scale: 1
    };
    PhotonView.prototype.update = function (machine) {
        // fixme: assert machine.nQubits == 1
        this.amplitude1 = machine.amplitudeList[0].abs();
        this.amplitude2 = machine.amplitudeList[1].abs();
        this.phase1 = machine.amplitudeList[0].arg();<commit_msg>simplified the photon polarization view<commit_after>// depends: jsqis-core.js
//
// depends: jQuery
// depends: raphael

jQuery.extend(window.jsqis, (function ($, Raphael) {

    var PhotonView = function (parentElement, machine, options) {
        this.options = $.extend({}, PhotonView.defaultOptions, options);
        var r1 = 50 * this.options.scale,
            r2 = 5 * this.options.scale;
        this.paper = Raphael(parentElement[0], 2 * r1, 2 * r1);
        this.paper.circle(r1, r1, r2 / 2).attr({fill: "#aaa", stroke: "none"});
        this.circle = this.paper.circle(r1, r1, r2).attr({fill: "#00a", stroke: "#00e"});
        this.t = 0;
        this.r3 = r1 - r2;
        this.update(machine);
        this.render();
    };
    PhotonView.defaultOptions = {
        scale: 1
    };
    PhotonView.prototype.update = function (machine) {
        // fixme: assert machine.nQubits == 1
        this.amplitude1 = machine.amplitudeList[0].abs();
        this.amplitude2 = machine.amplitudeList[1].abs();
        this.phase1 = machine.amplitudeList[0].arg();
{'fraction_non_alphanumeric': 0.16196542311191992, 'fraction_numerical': 0.03184713375796178, 'mean_word_length': 2.5698051948051948, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4512616', 'n_tokens_mistral': 777, 'n_tokens_neox': 727, 'n_words': 147}