<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Polynomial_quantum_speedups_in_the_oracle_model" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Polynomial quantum speedups in the oracle model</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Polynomial quantum speedups in the oracle model</h3>
<div
id="video_M3L19a"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:DYo9cI_f5gE", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19a/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19a"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1x" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Polynomial_quantum_speedups_in_the_oracle_model_-_AND_OR_tree" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Polynomial quantum speedups in the oracle model - AND OR tree</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Polynomial quantum speedups in the oracle model - AND OR tree</h3>
<div
id="video_M3L19b"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:Pxc1CJ6evSk", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19b/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19b"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2x" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Polynomial_quantum_speedups_in_the_oracle_model_-_collision_problem" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Polynomial quantum speedups in the oracle model - collision problem</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Polynomial quantum speedups in the oracle model - collision problem</h3>
<div
id="video_M3L19c"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:5ETjudKkD1Y", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19c/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19c"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3x" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Polynomial_quantum_speedups_in_the_oracle_model_-_element_distinctness" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Polynomial quantum speedups in the oracle model - element distinctness</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Polynomial quantum speedups in the oracle model - element distinctness</h3>
<div
id="video_M3L19d"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:3EcOD3SCCAQ", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19d/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19d"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box4x">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box4x" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Polynomial_quantum_speedups_in_the_oracle_model_-_graphs" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Polynomial quantum speedups in the oracle model - graphs</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Polynomial quantum speedups in the oracle model - graphs</h3>
<div
id="video_M3L19e"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:O1eGEV7oWEA", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19e/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19e"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box5">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box5" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@CQ_Polynomial_speedups" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">CQ: Polynomial speedups</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-block-type="problem" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_cq_M2L19_Polynomial_speedups" class="problems-wrapper" role="group"
aria-labelledby="cq_M2L19_Polynomial_speedups-problem-title"
data-problem-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups" data-url="/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="cq_M2L19_Polynomial_speedups-problem-title" aria-describedby="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups-problem-progress" tabindex="-1">
Polynomial speedups
</h3>
<div class="problem-progress" id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_Polynomial_speedups-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to check your understanding of the previous lecture video clips. </p>
<p>
Which of the following are true? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_cq_M2L19_Polynomial_speedups_2_1">
<fieldset aria-describedby="status_cq_M2L19_Polynomial_speedups_2_1">
<div class="field">
<input type="checkbox" name="input_cq_M2L19_Polynomial_speedups_2_1[]" id="input_cq_M2L19_Polynomial_speedups_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="cq_M2L19_Polynomial_speedups_2_1-choice_0-label" for="input_cq_M2L19_Polynomial_speedups_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_Polynomial_speedups_2_1">
<text>Classically computing the OR on [mathjaxinline]n[/mathjaxinline] boolean variables requires [mathjaxinline]\Omega (n)[/mathjaxinline] queries.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_Polynomial_speedups_2_1[]" id="input_cq_M2L19_Polynomial_speedups_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="cq_M2L19_Polynomial_speedups_2_1-choice_1-label" for="input_cq_M2L19_Polynomial_speedups_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_Polynomial_speedups_2_1">
<text>We may be able to do better than [mathjaxinline]O(\sqrt n)[/mathjaxinline] queries for the OR on [mathjaxinline]n[/mathjaxinline] boolean variable function in the quantum setting.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_Polynomial_speedups_2_1[]" id="input_cq_M2L19_Polynomial_speedups_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="cq_M2L19_Polynomial_speedups_2_1-choice_2-label" for="input_cq_M2L19_Polynomial_speedups_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_Polynomial_speedups_2_1">
<text>AND-OR trees can be solved in the quantum query model using [mathjaxinline]O(\sqrt n)[/mathjaxinline] queries.</text>
</label>
</div>
<span id="answer_cq_M2L19_Polynomial_speedups_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_cq_M2L19_Polynomial_speedups_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Polynomial speedups" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_cq_M2L19_Polynomial_speedups" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_cq_M2L19_Polynomial_speedups">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_Polynomial_speedups-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_Polynomial_speedups-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_Polynomial_speedups-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1xx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Grover_search_for_multiple_marked_items" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Grover search for multiple marked items</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Grover search for multiple marked items</h3>
<div
id="video_M3L19f"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:uhhGnPhXZr4", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19f/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19f"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box6">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box6" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Amplitude_amplification" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Amplitude amplification</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Amplitude amplification</h3>
<div
id="video_M3L19g"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:E4cYf3nzLOM", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19g/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19g"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box7">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box7" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Amplitude_amplification_-_comments" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Amplitude amplification - comments</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Amplitude amplification - comments</h3>
<div
id="video_M3L19h"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:o4WYjYuk3bg", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19h/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19h"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box8">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box8" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@CQ_Amplitude_amplification" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">CQ: Amplitude amplification</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-block-type="problem" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_cq_M2L19_LB_Amplitude_amplification_RB" class="problems-wrapper" role="group"
aria-labelledby="cq_M2L19_LB_Amplitude_amplification_RB-problem-title"
data-problem-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB" data-url="/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="cq_M2L19_LB_Amplitude_amplification_RB-problem-title" aria-describedby="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB-problem-progress" tabindex="-1">
Amplitude amplification
</h3>
<div class="problem-progress" id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Amplitude_amplification_RB-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to check your understanding of the previous lecture video clips. </p>
<p>
Which of the following are true? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<fieldset aria-describedby="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="cq_M2L19_LB_Amplitude_amplification_RB_2_1-choice_0-label" for="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<text>Amplitude amplification is possible only if the success probability is known in advance.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="cq_M2L19_LB_Amplitude_amplification_RB_2_1-choice_1-label" for="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<text>Grover's search with multiple items can be seen as a special case of amplitude amplification.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="cq_M2L19_LB_Amplitude_amplification_RB_2_1-choice_2-label" for="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<text>The product of the reflection operators in the Grover's algorithm with multiple marked items can be decomposed into [mathjaxinline]2 \times 2[/mathjaxinline] rotation blocks.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="cq_M2L19_LB_Amplitude_amplification_RB_2_1-choice_3-label" for="input_cq_M2L19_LB_Amplitude_amplification_RB_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1">
<text>The probability of success in any classical randomized algorithm can be boosted using amplitude amplification.</text>
</label>
</div>
<span id="answer_cq_M2L19_LB_Amplitude_amplification_RB_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_cq_M2L19_LB_Amplitude_amplification_RB_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Amplitude amplification" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_cq_M2L19_LB_Amplitude_amplification_RB" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_cq_M2L19_LB_Amplitude_amplification_RB">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Amplitude_amplification_RB-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Amplitude_amplification_RB-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Amplitude_amplification_RB-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2xx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Application_-_rejection_sampling_and_Gibbs_sampling" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Application - rejection sampling and Gibbs sampling</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Application - rejection sampling and Gibbs sampling</h3>
<div
id="video_M3L19j"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:UhGdwQBc-Ok", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19j/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19j"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box9">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box9" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@CQ_Application_of_amplitude_amplification" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">CQ: Application of amplitude amplification</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-block-type="problem" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_cq_M2L19_LB_Application_of_amplitude_amplification_RB" class="problems-wrapper" role="group"
aria-labelledby="cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-title"
data-problem-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB" data-url="/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-title" aria-describedby="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-progress" tabindex="-1">
Application of amplitude amplification
</h3>
<div class="problem-progress" id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to check your understanding of the previous lecture video clips. </p>
<p>
Which of the following are true? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1">
<fieldset aria-describedby="status_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1">
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1-choice_0-label" for="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1">
<text>Rejection sampling outputs a truly random point inside a particular shape.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1-choice_1-label" for="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1">
<text>Classical Gibbs sampling requires computation of a partition function.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1[]" id="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1-choice_2-label" for="input_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1">
<text>The quantum analogue of Gibbs sampling requires estimations to the eigenvalues of a certain Hamiltonian.</text>
</label>
</div>
<span id="answer_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_cq_M2L19_LB_Application_of_amplitude_amplification_RB_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Application of amplitude amplification" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_cq_M2L19_LB_Application_of_amplitude_amplification_RB" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_cq_M2L19_LB_Application_of_amplitude_amplification_RB">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Application_of_amplitude_amplification_RB-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3xx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Hamiltonian_simulation_-_problem_statement" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Hamiltonian simulation - problem statement</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Hamiltonian simulation - problem statement</h3>
<div
id="video_M3L19k"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:rl12quDvEaY", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19k/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19k"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box10">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box10" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Hamiltonian_simulation_-_using_amplitude_amplification" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Hamiltonian simulation - using amplitude amplification</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Hamiltonian simulation - using amplitude amplification</h3>
<div
id="video_M3L19m"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:kE0iwfrl9ts", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L19m/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L19m"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@site_search_box11">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@site_search_box11" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Hamiltonian_simulation_with_amplitude_amplification_-_setup" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Hamiltonian simulation with amplitude amplification - setup</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Hamiltonian simulation with amplitude amplification - setup</h3>
<div
id="video_M3L20a"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:aUtrs9SFS9g", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20a/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L20a"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1xxx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box1xxx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Hamiltonian_simulation_with_amplitude_amplification_-_linear_combination_of_unitaries" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Hamiltonian simulation with amplitude amplification - linear combination of unitaries</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Hamiltonian simulation with amplitude amplification - linear combination of unitaries</h3>
<div
id="video_M3L20b"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:ZYRvNHwWy1U", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20b/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L20b"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2xxx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box2xxx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@Hamiltonian_simulation_with_amplitude_amplification_-_success_probability_amplification" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">Hamiltonian simulation with amplitude amplification - success probability amplification</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c">
<div class="xblock xblock-public_view xblock-public_view-video xmodule_display xmodule_VideoBlock" data-has-score="False" data-block-type="video" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Video"}
</script>
<h3 class="hd hd-2">Hamiltonian simulation with amplitude amplification - success probability amplification</h3>
<div
id="video_M3L20c"
class="video closed"
data-metadata='{"savedVideoPosition": 0.0, "transcriptLanguage": "en", "ytTestTimeout": 1500, "lmsRootURL": "https://openlearninglibrary.mit.edu", "completionPercentage": 0.95, "transcriptAvailableTranslationsUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c/handler/transcript/available_translations", "saveStateUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c/handler/xmodule_handler/save_user_state", "prioritizeHls": false, "autoplay": false, "ytApiUrl": "https://www.youtube.com/iframe_api", "showCaptions": "true", "start": 0.0, "autoAdvance": false, "ytMetadataEndpoint": "", "publishCompletionUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c/handler/publish_completion", "poster": null, "autohideHtml5": false, "sources": [], "recordedYoutubeIsAvailable": true, "completionEnabled": false, "streams": "1.00:aEw741CNBpA", "saveStateEnabled": false, "end": 0.0, "transcriptLanguages": {"en": "English"}, "generalSpeed": 1.0, "captionDataDir": null, "duration": 0.0, "speed": null, "transcriptTranslationUrl": "/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@video+block@M3L20c/handler/transcript/translation/__lang__"}'
data-bumper-metadata='null'
data-autoadvance-enabled="False"
data-poster='null'
tabindex="-1"
>
<div class="focus_grabber first"></div>
<div class="tc-wrapper">
<div class="video-wrapper">
<span tabindex="0" class="spinner" aria-hidden="false" aria-label="Loading video player"></span>
<span tabindex="-1" class="btn-play fa fa-youtube-play fa-2x is-hidden" aria-hidden="true" aria-label="Play video"></span>
<div class="video-player-pre"></div>
<div class="video-player">
<div id="M3L20c"></div>
<h4 class="hd hd-4 video-error is-hidden">No playable video sources found.</h4>
<h4 class="hd hd-4 video-hls-error is-hidden">
Your browser does not support this video format. Try using a different browser.
</h4>
</div>
<div class="video-player-post"></div>
<div class="closed-captions"></div>
<div class="video-controls is-hidden">
<div>
<div class="vcr"><div class="vidtime">0:00 / 0:00</div></div>
<div class="secondary-controls"></div>
</div>
</div>
</div>
</div>
<div class="focus_grabber last"></div>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3xxx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box3xxx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-has-score="False" data-block-type="vertical" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@vertical+block@CQ_Hamiltonian_simulation" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<h2 class="hd hd-2 unit-title">CQ: Hamiltonian simulation</h2>
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-has-score="True" data-block-type="problem" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "Problem"}
</script>
<div id="problem_cq_M2L19_LB_Hamiltonian_simulation_RB" class="problems-wrapper" role="group"
aria-labelledby="cq_M2L19_LB_Hamiltonian_simulation_RB-problem-title"
data-problem-id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB" data-url="/courses/course-v1:MITx+8.371.3x+2T2018/xblock/block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB/handler/xmodule_handler"
data-problem-score="0"
data-problem-total-possible="1"
data-attempts-used="0"
data-content="
<h3 class="hd hd-3 problem-header" id="cq_M2L19_LB_Hamiltonian_simulation_RB-problem-title" aria-describedby="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB-problem-progress" tabindex="-1">
Hamiltonian simulation
</h3>
<div class="problem-progress" id="block-v1:MITx+8.371.3x+2T2018+type@problem+block@cq_M2L19_LB_Hamiltonian_simulation_RB-problem-progress"></div>
<div class="problem">
<div>
<p>
This is a concept question, provided to check your understanding of the previous lecture video clips. </p>
<p>
Which of the following are true? </p>
<p>
<div class="wrapper-problem-response" tabindex="-1" aria-label="Question 1" role="group"><div class="choicegroup capa_inputtype" id="inputtype_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<fieldset aria-describedby="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1[]" id="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_0" class="field-input input-checkbox" value="choice_0"/><label id="cq_M2L19_LB_Hamiltonian_simulation_RB_2_1-choice_0-label" for="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_0" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<text>The error in Trotter's formula scales like the sum of operator norms of each term.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1[]" id="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_1" class="field-input input-checkbox" value="choice_1"/><label id="cq_M2L19_LB_Hamiltonian_simulation_RB_2_1-choice_1-label" for="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_1" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<text>The run time in the Hamiltonian simulation depends on the norm of Hamiltonian.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1[]" id="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_2" class="field-input input-checkbox" value="choice_2"/><label id="cq_M2L19_LB_Hamiltonian_simulation_RB_2_1-choice_2-label" for="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_2" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<text>The improved Hamiltonian simulation algorithm works only if the representation of the Hamiltonian is given to us as a linear combination of unitary operators.</text>
</label>
</div>
<div class="field">
<input type="checkbox" name="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1[]" id="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_3" class="field-input input-checkbox" value="choice_3"/><label id="cq_M2L19_LB_Hamiltonian_simulation_RB_2_1-choice_3-label" for="input_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1_choice_3" class="response-label field-label label-inline" aria-describedby="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1">
<text>Since the post-selection step in the quantum Hamiltonian simulation we discussed succeeds with constant probability, we can repeat it a constant number of times to make the overall algorithm succeed with high probability.</text>
</label>
</div>
<span id="answer_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1"/>
</fieldset>
<div class="indicator-container">
<span class="status unanswered" id="status_cq_M2L19_LB_Hamiltonian_simulation_RB_2_1" data-tooltip="Not yet answered.">
<span class="sr">unanswered</span><span class="status-icon" aria-hidden="true"/>
</span>
</div>
</div></div>
</p>
</div>
<div class="action">
<input type="hidden" name="problem_id" value="Hamiltonian simulation" />
<div class="submit-attempt-container">
<button type="button" class="submit btn-brand" data-submitting="Submitting" data-value="Submit" data-should-enable-submit-button="True" aria-describedby="submission_feedback_cq_M2L19_LB_Hamiltonian_simulation_RB" >
<span class="submit-label">Submit</span>
</button>
<div class="submission-feedback" id="submission_feedback_cq_M2L19_LB_Hamiltonian_simulation_RB">
<span class="sr">Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.</span>
</div>
</div>
<div class="problem-action-buttons-wrapper">
<span class="problem-action-button-wrapper">
<button type="button" class="save problem-action-btn btn-default btn-small" data-value="Save">
<span class="icon fa fa-floppy-o" aria-hidden="true"></span>
<span aria-hidden="true">Save</span>
<span class="sr">Save your answer</span>
</button>
</span>
</div>
</div>
<div class="notification warning notification-gentle-alert
is-hidden"
tabindex="-1">
<span class="icon fa fa-exclamation-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Hamiltonian_simulation_RB-problem-title">
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification warning notification-save
is-hidden"
tabindex="-1">
<span class="icon fa fa-save" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Hamiltonian_simulation_RB-problem-title">None
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
<div class="notification general notification-show-answer
is-hidden"
tabindex="-1">
<span class="icon fa fa-info-circle" aria-hidden="true"></span>
<span class="notification-message" aria-describedby="cq_M2L19_LB_Hamiltonian_simulation_RB-problem-title">Answers are displayed within the problem
</span>
<div class="notification-btn-wrapper">
<button type="button" class="btn btn-default btn-small notification-btn review-btn sr">Review</button>
</div>
</div>
</div>
"
data-graded="True">
<p class="loading-spinner">
<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i>
<span class="sr">Loading…</span>
</p>
</div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box4xx">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-has-score="False" data-block-type="html" data-request-token="1a26e65a886411ef894112578eed8dbf" data-usage-id="block-v1:MITx+8.371.3x+2T2018+type@html+block@html_site_search_box4xx" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-graded="True" data-course-id="course-v1:MITx+8.371.3x+2T2018">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<span><a href="/asset-v1:MITx+8.371.3x+2T2018+type@asset+block/NONE" id="dummy_course_static_link" style="display:none"/><a href="/courses/course-v1:MITx+8.371.3x+2T2018/jump_to_id/NONE" id="dummy_jump_link" style="display:none"/><script type="text/javascript">
var add_site_search = function(){
course_static_url = $('#dummy_course_static_link').attr('href').replace('/NONE', '');
jump_to_url = $('#dummy_jump_link').attr('href').replace('/NONE', '');
if (typeof String.prototype.startsWith != 'function') {
// see below for better implementation!
String.prototype.startsWith = function (str){
return this.indexOf(str) === 0;
};
}
if(typeof(String.prototype.trim) === "undefined")
{
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
}
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var amp = String.fromCharCode(38);
var rlb = rb + lb;
var mke = function(x){ return lb + x + rb; }
var search_module_url = "";
var get_search_module_ficus = function(){
var cid = $('div.xblock').data('course-id');
if (cid){
console.log("cid = ", cid);
// search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/" + cid + "/courseware/welcome/Search_this_course/";
search_module_url = "/courses/course-v1:MITx+8.371.3x+2T2018/courseware/welcome/Search_this_course/"; // automatically rewritten
console.log("3. search_module_url = ", search_module_url);
return;
}
var course_root_link = $('span.nav-item-course').find('a').attr('href');
if (course_root_link){
console.log("course_root_link = ", course_root_link);
search_module_url = course_root_link.replace("course/", "courseware/welcome/Search_this_course/");
console.log("2. search_module_url = ", search_module_url);
return
}
console.log("cannot determine search module url");
}
var get_search_module = function(){
// find search this module link
if (!($('div.course-index').length)){
return get_search_module_ficus();
}
$('div.course-index').find('nav').find('a').each(function(){
if ($(this).text().trim().startsWith("Search this course")){
search_module_url = $(this).attr('href');
console.log("search_module_url = ", search_module_url);
}
});
}
var go_to_search = function(){
get_search_module();
var sterm = $('#site-search-box').val();
// new_url = jump_to_url + "/Search_this_module/?q=" + sterm;
new_url = search_module_url + "?q=" + sterm;
console.log("sterm = ", sterm, " ; going to ", new_url);
window.location.href = new_url;
}
if (!$('#site-search-box').length){
$("nav.courseware").find("ol").append(lb + "section style='float:right'" + rlb + "input size='20'"
+ " id='site-search-box'"
+ rlb + "img src='" + course_static_url
+ "/images_search_glass.png'/" + rlb + "/input" + rlb + "/section" + rb);
}
$("#site-search-box").keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
go_to_search();
}
});
// $('#site-search-box').bind("enterKey", go_to_search);
var get = function(x){
return eval(x);
}
return {'course_static_url': course_static_url,
'jump_to_url': jump_to_url,
'go_to_search': go_to_search,
'get_search_module': get_search_module,
'get_search_module_ficus': get_search_module_ficus,
'get': get,
}
}
var the_site_search = add_site_search();
var add_fix_transcript = function(){
if ($('div.wrap-instructor-info').length==0){
return;
}
$('div.xblock-student_view-video').each(function(key, vblock_e){
var vblock = $(vblock_e);
var vuid = vblock.data('usage-id').split('@');
var vid;
if (vuid.length==1){
vuid = vblock.data('usage-id').split(';_')
vid = vuid[5];
}else{
vid = vuid[2];
}
var mfnpre = vid.split("_video",1)[0];
var mfnid = mfnpre; // no periods
mfnpre = mfnpre.replace('8_370', '8.370'); // periods in gh filename
var lb = String.fromCharCode(60);
var rb = String.fromCharCode(62);
var mke = function(x){ return lb + x + rb; }
var ftid = "fix_transcript_" + mfnid;
if (!$('#' + ftid).length){
var html = lb + "span id='" + ftid + "' style='float:right'" + rb + lb + "a href='#'" + rb;
html += "contribute transcript fix" + mke("/a") + mke("/span");
console.log("html = ", html);
vblock.after(html)
}
$('#' + ftid).click(function(){
var cst = $('ol.subtitles').find('li.current');
var cindex = Number(cst.data('index'));
var gurl;
if (mfnpre.endsWith('_cq_sol')){
gurl = "https://github.com/mitocw/content-mit-8370x-cq-sol-subtitles/blob/master/";
}else{
gurl = "https://github.com/mitocw/content-mit-8370x-subtitles/blob/master/";
}
gurl += mfnpre + ".txt#L" + String(cindex + 10 + 1);
console.log("going to ", gurl);
window.open(gurl, "MITx 8.370x subtitle source");
});
});
}
try{
add_fix_transcript();
}
catch(err){
console.log(err);
}
try{
var rb = String.fromCharCode(62);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 3000);
setTimeout(function(){ $('.math' + rb + 'span').css("border-left-color","transparent"); }, 8000);
}
catch(err){
console.log(err);
}
</script></span>
</div>
</div>
</div>
</div>
© All Rights Reserved